merge heads
authorAnssi Kostiainen <anssi.kostiainen@nokia.com>
Mon, 27 Aug 2012 09:51:00 +0300
changeset 2031c5a2f31a18d
parent 202 444a05503706
child 204 58fadbd65d13
merge heads
discovery-api/Overview.html
discovery-api/Overview.src.html
     1.1 --- a/discovery-api/Overview.html	Sat Aug 25 00:52:13 2012 +0300
     1.2 +++ b/discovery-api/Overview.html	Mon Aug 27 09:51:00 2012 +0300
     1.3 @@ -1,361 +1,8 @@
     1.4 -<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
     1.5 -<html lang="en" dir="ltr" about="" property="dc:language" content="en" prefix="dc: http://purl.org/dc/terms/ bibo: http://purl.org/ontology/bibo/ foaf: http://xmlns.com/foaf/0.1/ xsd: http://www.w3.org/2001/XMLSchema#">
     1.6 +<!DOCTYPE html>
     1.7 +<html lang="en" dir="ltr">
     1.8  <head>
     1.9      <title>Networked Service Discovery and Messaging</title>
    1.10      <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    1.11 -    <!-- This spec has been compiled with ReSpec v2 -->
    1.12 -
    1.13 -
    1.14 -    <style type="text/css">
    1.15 -      /**
    1.16 -       * SyntaxHighlighter
    1.17 -       * http://alexgorbatchev.com/SyntaxHighlighter
    1.18 -       *
    1.19 -       * SyntaxHighlighter is donationware. If you are using it, please donate.
    1.20 -       * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
    1.21 -       *
    1.22 -       * @version
    1.23 -       * 3.0.83 (July 02 2010)
    1.24 -       *
    1.25 -       * @copyright
    1.26 -       * Copyright (C) 2004-2010 Alex Gorbatchev.
    1.27 -       *
    1.28 -       * @license
    1.29 -       * Dual licensed under the MIT and GPL licenses.
    1.30 -       */
    1.31 -      .syntaxhighlighter a,
    1.32 -      .syntaxhighlighter div,
    1.33 -      .syntaxhighlighter code,
    1.34 -      .syntaxhighlighter table,
    1.35 -      .syntaxhighlighter table td,
    1.36 -      .syntaxhighlighter table tr,
    1.37 -      .syntaxhighlighter table tbody,
    1.38 -      .syntaxhighlighter table thead,
    1.39 -      .syntaxhighlighter table caption,
    1.40 -      .syntaxhighlighter textarea {
    1.41 -        -moz-border-radius: 0 0 0 0 !important;
    1.42 -        -webkit-border-radius: 0 0 0 0 !important;
    1.43 -        background: none !important;
    1.44 -        border: 0 !important;
    1.45 -        bottom: auto !important;
    1.46 -        float: none !important;
    1.47 -        height: auto !important;
    1.48 -        left: auto !important;
    1.49 -        line-height: 1.1em !important;
    1.50 -        margin: 0 !important;
    1.51 -        outline: 0 !important;
    1.52 -        overflow: visible !important;
    1.53 -        padding: 0 !important;
    1.54 -        position: static !important;
    1.55 -        right: auto !important;
    1.56 -        text-align: left !important;
    1.57 -        top: auto !important;
    1.58 -        vertical-align: baseline !important;
    1.59 -        width: auto !important;
    1.60 -        box-sizing: content-box !important;
    1.61 -        font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
    1.62 -        font-weight: normal !important;
    1.63 -        font-style: normal !important;
    1.64 -        font-size: 1em !important;
    1.65 -        min-height: inherit !important;
    1.66 -        min-height: auto !important;
    1.67 -      }
    1.68 -
    1.69 -      .syntaxhighlighter {
    1.70 -        width: 100% !important;
    1.71 -        margin: 1em 0 1em 0 !important;
    1.72 -        position: relative !important;
    1.73 -        overflow: auto !important;
    1.74 -        font-size: 0.8em !important;
    1.75 -      }
    1.76 -      .syntaxhighlighter.source {
    1.77 -        overflow: hidden !important;
    1.78 -      }
    1.79 -      .syntaxhighlighter .bold {
    1.80 -        font-weight: bold !important;
    1.81 -      }
    1.82 -      .syntaxhighlighter .italic {
    1.83 -        font-style: italic !important;
    1.84 -      }
    1.85 -      .syntaxhighlighter .line {
    1.86 -        white-space: pre !important;
    1.87 -      }
    1.88 -      .syntaxhighlighter table {
    1.89 -        width: 100% !important;
    1.90 -      }
    1.91 -      .syntaxhighlighter table caption {
    1.92 -        text-align: left !important;
    1.93 -        padding: .5em 0 0.5em 1em !important;
    1.94 -      }
    1.95 -      .syntaxhighlighter table td.code {
    1.96 -        width: 100% !important;
    1.97 -      }
    1.98 -      .syntaxhighlighter table td.code .container {
    1.99 -        position: relative !important;
   1.100 -      }
   1.101 -      .syntaxhighlighter table td.code .container textarea {
   1.102 -        box-sizing: border-box !important;
   1.103 -        position: absolute !important;
   1.104 -        left: 0 !important;
   1.105 -        top: 0 !important;
   1.106 -        width: 100% !important;
   1.107 -        height: 100% !important;
   1.108 -        border: none !important;
   1.109 -
   1.110 -        padding-left: 1em !important;
   1.111 -        overflow: hidden !important;
   1.112 -        white-space: pre !important;
   1.113 -      }
   1.114 -      .syntaxhighlighter table td.gutter .line {
   1.115 -        text-align: right !important;
   1.116 -        padding: 0 0.5em 0 1em !important;
   1.117 -      }
   1.118 -      .syntaxhighlighter table td.code .line {
   1.119 -        padding: 0 1em !important;
   1.120 -      }
   1.121 -      .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
   1.122 -        padding-left: 0em !important;
   1.123 -      }
   1.124 -      .syntaxhighlighter.show {
   1.125 -        display: block !important;
   1.126 -      }
   1.127 -      .syntaxhighlighter.collapsed table {
   1.128 -        display: none !important;
   1.129 -      }
   1.130 -      .syntaxhighlighter.collapsed .toolbar {
   1.131 -        padding: 0.1em 0.8em 0em 0.8em !important;
   1.132 -        font-size: 1em !important;
   1.133 -        position: static !important;
   1.134 -        width: auto !important;
   1.135 -        height: auto !important;
   1.136 -      }
   1.137 -      .syntaxhighlighter.collapsed .toolbar span {
   1.138 -        display: inline !important;
   1.139 -        margin-right: 1em !important;
   1.140 -      }
   1.141 -      .syntaxhighlighter.collapsed .toolbar span a {
   1.142 -        padding: 0 !important;
   1.143 -        display: none !important;
   1.144 -      }
   1.145 -      .syntaxhighlighter.collapsed .toolbar span a.expandSource {
   1.146 -        display: inline !important;
   1.147 -      }
   1.148 -      .syntaxhighlighter .toolbar {
   1.149 -        position: absolute !important;
   1.150 -        right: 1px !important;
   1.151 -        top: 1px !important;
   1.152 -        width: 11px !important;
   1.153 -        height: 11px !important;
   1.154 -        font-size: 10px !important;
   1.155 -        z-index: 10 !important;
   1.156 -      }
   1.157 -      .syntaxhighlighter .toolbar span.title {
   1.158 -        display: inline !important;
   1.159 -      }
   1.160 -      .syntaxhighlighter .toolbar a {
   1.161 -        display: block !important;
   1.162 -        text-align: center !important;
   1.163 -        text-decoration: none !important;
   1.164 -        padding-top: 1px !important;
   1.165 -      }
   1.166 -      .syntaxhighlighter .toolbar a.expandSource {
   1.167 -        display: none !important;
   1.168 -      }
   1.169 -      .syntaxhighlighter.ie {
   1.170 -        font-size: .9em !important;
   1.171 -        padding: 1px 0 1px 0 !important;
   1.172 -      }
   1.173 -      .syntaxhighlighter.ie .toolbar {
   1.174 -        line-height: 8px !important;
   1.175 -      }
   1.176 -      .syntaxhighlighter.ie .toolbar a {
   1.177 -        padding-top: 0px !important;
   1.178 -      }
   1.179 -      .syntaxhighlighter.printing .line.alt1 .content,
   1.180 -      .syntaxhighlighter.printing .line.alt2 .content,
   1.181 -      .syntaxhighlighter.printing .line.highlighted .number,
   1.182 -      .syntaxhighlighter.printing .line.highlighted.alt1 .content,
   1.183 -      .syntaxhighlighter.printing .line.highlighted.alt2 .content {
   1.184 -        background: none !important;
   1.185 -      }
   1.186 -      .syntaxhighlighter.printing .line .number {
   1.187 -        color: #bbbbbb !important;
   1.188 -      }
   1.189 -      .syntaxhighlighter.printing .line .content {
   1.190 -        color: black !important;
   1.191 -      }
   1.192 -      .syntaxhighlighter.printing .toolbar {
   1.193 -        display: none !important;
   1.194 -      }
   1.195 -      .syntaxhighlighter.printing a {
   1.196 -        text-decoration: none !important;
   1.197 -      }
   1.198 -      .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
   1.199 -        color: black !important;
   1.200 -      }
   1.201 -      .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
   1.202 -        color: #008200 !important;
   1.203 -      }
   1.204 -      .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
   1.205 -        color: blue !important;
   1.206 -      }
   1.207 -      .syntaxhighlighter.printing .keyword {
   1.208 -        color: #006699 !important;
   1.209 -        font-weight: bold !important;
   1.210 -      }
   1.211 -      .syntaxhighlighter.printing .preprocessor {
   1.212 -        color: gray !important;
   1.213 -      }
   1.214 -      .syntaxhighlighter.printing .variable {
   1.215 -        color: #aa7700 !important;
   1.216 -      }
   1.217 -      .syntaxhighlighter.printing .value {
   1.218 -        color: #009900 !important;
   1.219 -      }
   1.220 -      .syntaxhighlighter.printing .functions {
   1.221 -        color: #ff1493 !important;
   1.222 -      }
   1.223 -      .syntaxhighlighter.printing .constants {
   1.224 -        color: #0066cc !important;
   1.225 -      }
   1.226 -      .syntaxhighlighter.printing .script {
   1.227 -        font-weight: bold !important;
   1.228 -      }
   1.229 -      .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
   1.230 -        color: gray !important;
   1.231 -      }
   1.232 -      .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
   1.233 -        color: #ff1493 !important;
   1.234 -      }
   1.235 -      .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
   1.236 -        color: red !important;
   1.237 -      }
   1.238 -      .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
   1.239 -        color: black !important;
   1.240 -      }
   1.241 -    </style>
   1.242 -    <style type="text/css">
   1.243 -      /**
   1.244 -       * SyntaxHighlighter
   1.245 -       * http://alexgorbatchev.com/SyntaxHighlighter
   1.246 -       *
   1.247 -       * SyntaxHighlighter is donationware. If you are using it, please donate.
   1.248 -       * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
   1.249 -       *
   1.250 -       * @version
   1.251 -       * 3.0.83 (July 02 2010)
   1.252 -       *
   1.253 -       * @copyright
   1.254 -       * Copyright (C) 2004-2010 Alex Gorbatchev.
   1.255 -       *
   1.256 -       * @license
   1.257 -       * Dual licensed under the MIT and GPL licenses.
   1.258 -       */
   1.259 -      .syntaxhighlighter {
   1.260 -        background-color: none !important;
   1.261 -      }
   1.262 -      .syntaxhighlighter .line.alt1 {
   1.263 -        background-color: none !important;
   1.264 -      }
   1.265 -      .syntaxhighlighter .line.alt2 {
   1.266 -        background-color: none !important;
   1.267 -      }
   1.268 -      .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
   1.269 -        background-color: none !important;
   1.270 -      }
   1.271 -      .syntaxhighlighter .line.highlighted.number {
   1.272 -        color: black !important;
   1.273 -      }
   1.274 -      .syntaxhighlighter table caption {
   1.275 -        color: black !important;
   1.276 -      }
   1.277 -      .syntaxhighlighter .gutter {
   1.278 -        color: #afafaf !important;
   1.279 -      }
   1.280 -      .syntaxhighlighter .gutter .line {
   1.281 -        border-right: 3px solid #6ce26c !important;
   1.282 -      }
   1.283 -      .syntaxhighlighter .gutter .line.highlighted {
   1.284 -        background-color: #6ce26c !important;
   1.285 -        color: white !important;
   1.286 -      }
   1.287 -      .syntaxhighlighter.printing .line .content {
   1.288 -        border: none !important;
   1.289 -      }
   1.290 -      .syntaxhighlighter.collapsed {
   1.291 -        overflow: visible !important;
   1.292 -      }
   1.293 -      .syntaxhighlighter.collapsed .toolbar {
   1.294 -        color: blue !important;
   1.295 -        background: none !important;
   1.296 -        border: 1px solid #6ce26c !important;
   1.297 -      }
   1.298 -      .syntaxhighlighter.collapsed .toolbar a {
   1.299 -        color: blue !important;
   1.300 -      }
   1.301 -      .syntaxhighlighter.collapsed .toolbar a:hover {
   1.302 -        color: red !important;
   1.303 -      }
   1.304 -      .syntaxhighlighter .toolbar {
   1.305 -        color: white !important;
   1.306 -        background: #6ce26c !important;
   1.307 -        border: none !important;
   1.308 -      }
   1.309 -      .syntaxhighlighter .toolbar a {
   1.310 -        color: white !important;
   1.311 -      }
   1.312 -      .syntaxhighlighter .toolbar a:hover {
   1.313 -        color: black !important;
   1.314 -      }
   1.315 -      .syntaxhighlighter .plain, .syntaxhighlighter .plain a {
   1.316 -        color: black !important;
   1.317 -      }
   1.318 -      .syntaxhighlighter .comments, .syntaxhighlighter .comments a {
   1.319 -        color: #008200 !important;
   1.320 -      }
   1.321 -      .syntaxhighlighter .string, .syntaxhighlighter .string a {
   1.322 -        color: blue !important;
   1.323 -      }
   1.324 -      .syntaxhighlighter .keyword {
   1.325 -        color: #006699 !important;
   1.326 -      }
   1.327 -      .syntaxhighlighter .preprocessor {
   1.328 -        color: gray !important;
   1.329 -      }
   1.330 -      .syntaxhighlighter .variable {
   1.331 -        color: #aa7700 !important;
   1.332 -      }
   1.333 -      .syntaxhighlighter .value {
   1.334 -        color: #009900 !important;
   1.335 -      }
   1.336 -      .syntaxhighlighter .functions {
   1.337 -        color: #ff1493 !important;
   1.338 -      }
   1.339 -      .syntaxhighlighter .constants {
   1.340 -        color: #0066cc !important;
   1.341 -      }
   1.342 -      .syntaxhighlighter .script {
   1.343 -        font-weight: bold !important;
   1.344 -        color: #006699 !important;
   1.345 -        background-color: none !important;
   1.346 -      }
   1.347 -      .syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
   1.348 -        color: gray !important;
   1.349 -      }
   1.350 -      .syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
   1.351 -        color: #ff1493 !important;
   1.352 -      }
   1.353 -      .syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
   1.354 -        color: red !important;
   1.355 -      }
   1.356 -
   1.357 -      .syntaxhighlighter .keyword {
   1.358 -        font-weight: bold !important;
   1.359 -      }
   1.360 -    </style>
   1.361 -
   1.362 -
   1.363 -
   1.364  
   1.365  
   1.366  
   1.367 @@ -386,17 +33,9 @@
   1.368        dl.domintro code {font-size: inherit; font-style: italic; }
   1.369        dl.domintro:before { display: table; margin: -1em -0.5em 0.5em auto; width: auto; content: 'This box is non-normative. Implementation requirements are given below this box.'; color: red; border: solid 2px; background: white; padding: 0 0.25em; }
   1.370      </style>
   1.371 -  <style type="text/css">
   1.372 -/*
   1.373 -    XXX this is not up to date with the needs of various other parts, it will require
   1.374 -        to be synched up with the latest developments
   1.375 -        It may be that this will be split up so that only the parts that are acually used
   1.376 -        by the document get to be included (e.g. WebIDL).
   1.377 -*/
   1.378 -
   1.379 -/*****************************************************************
   1.380 - * ReSpec 2 CSS
   1.381 - * Robin Berjon, 2010-01-04
   1.382 +  <style>/*****************************************************************
   1.383 + * ReSpec 3 CSS
   1.384 + * Robin Berjon - http://berjon.com/
   1.385   *****************************************************************/
   1.386  
   1.387  /* --- INLINES --- */
   1.388 @@ -418,13 +57,13 @@
   1.389  
   1.390  a.internalDFN {
   1.391      color:  inherit;
   1.392 -    border-bottom:  medium solid #99c;
   1.393 +    border-bottom:  1px solid #99c;
   1.394      text-decoration:    none;
   1.395  }
   1.396  
   1.397  a.externalDFN {
   1.398      color:  inherit;
   1.399 -    border-bottom:  medium dotted #ccc;
   1.400 +    border-bottom:  1px dotted #ccc;
   1.401      text-decoration:    none;
   1.402  }
   1.403  
   1.404 @@ -432,224 +71,36 @@
   1.405      text-decoration:    none;
   1.406  }
   1.407  
   1.408 +cite .bibref {
   1.409 +    font-style: normal;
   1.410 +}
   1.411 +
   1.412  code {
   1.413      color:  #ff4500;
   1.414  }
   1.415  
   1.416  
   1.417 -/* --- WEB IDL --- */
   1.418 -pre.idl {
   1.419 -    border-top: 1px solid #90b8de;
   1.420 -    border-bottom: 1px solid #90b8de;
   1.421 -    padding:    1em;
   1.422 -    line-height:    120%;
   1.423 -}
   1.424 +/* --- --- */
   1.425 +ol.algorithm { counter-reset:numsection; list-style-type: none; }
   1.426 +ol.algorithm li { margin: 0.5em 0; }
   1.427 +ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
   1.428  
   1.429 -pre.idl::before {
   1.430 -    content:    "WebIDL";
   1.431 -    display:    block;
   1.432 -    width:      150px;
   1.433 -    background: #90b8de;
   1.434 -    color:  #fff;
   1.435 -    font-family:    initial;
   1.436 -    padding:    3px;
   1.437 -    font-weight:    bold;
   1.438 -    margin: -1em 0 1em -1em;
   1.439 -}
   1.440 -
   1.441 -.idlType {
   1.442 -    color:  #ff4500;
   1.443 -    font-weight:    bold;
   1.444 +/* --- TOC --- */
   1.445 +.toc a, .tof a {
   1.446      text-decoration:    none;
   1.447  }
   1.448  
   1.449 -/*.idlModule*/
   1.450 -/*.idlModuleID*/
   1.451 -/*.idlInterface*/
   1.452 -.idlInterfaceID {
   1.453 -    font-weight:    bold;
   1.454 -    color:  #005a9c;
   1.455 +a .secno, a .figno {
   1.456 +    color:  #000;
   1.457  }
   1.458  
   1.459 -.idlSuperclass {
   1.460 -    font-style: italic;
   1.461 -    color:  #005a9c;
   1.462 +ul.tof, ol.tof {
   1.463 +    list-style: none outside none;
   1.464  }
   1.465  
   1.466 -/*.idlAttribute*/
   1.467 -.idlAttrType {
   1.468 -    color:  #005a9c;
   1.469 -}
   1.470 -.idlAttrName {
   1.471 -    color:  #ff4500;
   1.472 -}
   1.473 -.idlAttrName a {
   1.474 -    color:  #ff4500;
   1.475 -    border-bottom:  1px dotted #ff4500;
   1.476 -    text-decoration: none;
   1.477 -}
   1.478 -
   1.479 -/*.idlMethod*/
   1.480 -.idlMethType {
   1.481 -    color:  #005a9c;
   1.482 -}
   1.483 -.idlMethName {
   1.484 -    color:  #ff4500;
   1.485 -}
   1.486 -.idlMethName a {
   1.487 -    color:  #ff4500;
   1.488 -    border-bottom:  1px dotted #ff4500;
   1.489 -    text-decoration: none;
   1.490 -}
   1.491 -
   1.492 -/*.idlParam*/
   1.493 -.idlParamType {
   1.494 -    color:  #005a9c;
   1.495 -}
   1.496 -.idlParamName {
   1.497 -    font-style: italic;
   1.498 -}
   1.499 -
   1.500 -.extAttr {
   1.501 -    color:  #666;
   1.502 -}
   1.503 -
   1.504 -/*.idlConst*/
   1.505 -.idlConstType {
   1.506 -    color:  #005a9c;
   1.507 -}
   1.508 -.idlConstName {
   1.509 -    color:  #ff4500;
   1.510 -}
   1.511 -.idlConstName a {
   1.512 -    color:  #ff4500;
   1.513 -    border-bottom:  1px dotted #ff4500;
   1.514 -    text-decoration: none;
   1.515 -}
   1.516 -
   1.517 -/*.idlException*/
   1.518 -.idlExceptionID {
   1.519 -    font-weight:    bold;
   1.520 -    color:  #c00;
   1.521 -}
   1.522 -
   1.523 -.idlTypedefID, .idlTypedefType {
   1.524 -    color:  #005a9c;
   1.525 -}
   1.526 -
   1.527 -.idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {
   1.528 -    color:  #c00;
   1.529 -    font-weight:    normal;
   1.530 -}
   1.531 -
   1.532 -.excName a {
   1.533 -    font-family:    monospace;
   1.534 -}
   1.535 -
   1.536 -.idlRaises a.idlType, .excName a.idlType {
   1.537 -    border-bottom:  1px dotted #c00;
   1.538 -}
   1.539 -
   1.540 -.excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {
   1.541 -    width:  45px;
   1.542 -    text-align: center;
   1.543 -}
   1.544 -.excGetSetTrue, .prmNullTrue, .prmOptTrue { color:  #0c0; }
   1.545 -.excGetSetFalse, .prmNullFalse, .prmOptFalse { color:  #c00; }
   1.546 -
   1.547 -.idlImplements a {
   1.548 -    font-weight:    bold;
   1.549 -}
   1.550 -
   1.551 -dl.attributes, dl.methods, dl.constants {
   1.552 -    margin-left:    2em;
   1.553 -}
   1.554 -
   1.555 -.attributes dt, .methods dt, .constants dt {
   1.556 -    font-weight:    normal;
   1.557 -}
   1.558 -
   1.559 -.attributes dt code, .methods dt code, .constants dt code {
   1.560 -    font-weight:    bold;
   1.561 -    color:  #000;
   1.562 -    font-family:    monospace;
   1.563 -}
   1.564 -
   1.565 -.attributes dt code {
   1.566 -    background:  #ffffd2;
   1.567 -}
   1.568 -
   1.569 -.attributes dt .idlAttrType code {
   1.570 -    color:  #005a9c;
   1.571 -    background:  transparent;
   1.572 -    font-family:    inherit;
   1.573 -    font-weight:    normal;
   1.574 -    font-style: italic;
   1.575 -}
   1.576 -
   1.577 -.methods dt code {
   1.578 -    background:  #d9e6f8;
   1.579 -}
   1.580 -
   1.581 -.constants dt code {
   1.582 -    background:  #ddffd2;
   1.583 -}
   1.584 -
   1.585 -.attributes dd, .methods dd, .constants dd {
   1.586 -    margin-bottom:  1em;
   1.587 -}
   1.588 -
   1.589 -table.parameters, table.exceptions {
   1.590 -    border-spacing: 0;
   1.591 -    border-collapse:    collapse;
   1.592 -    margin: 0.5em 0;
   1.593 -    width:  100%;
   1.594 -}
   1.595 -table.parameters { border-bottom:  1px solid #90b8de; }
   1.596 -table.exceptions { border-bottom:  1px solid #deb890; }
   1.597 -
   1.598 -.parameters th, .exceptions th {
   1.599 -    color:  #fff;
   1.600 -    padding:    3px 5px;
   1.601 -    text-align: left;
   1.602 -    font-family:    initial;
   1.603 -    font-weight:    normal;
   1.604 -    text-shadow:    #666 1px 1px 0;
   1.605 -}
   1.606 -.parameters th { background: #90b8de; }
   1.607 -.exceptions th { background: #deb890; }
   1.608 -
   1.609 -.parameters td, .exceptions td {
   1.610 -    padding:    3px 10px;
   1.611 -    border-top: 1px solid #ddd;
   1.612 -    vertical-align: top;
   1.613 -}
   1.614 -
   1.615 -.parameters tr:first-child td, .exceptions tr:first-child td {
   1.616 -    border-top: none;
   1.617 -}
   1.618 -
   1.619 -.parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {
   1.620 -    width:  100px;
   1.621 -}
   1.622 -
   1.623 -.parameters td.prmType {
   1.624 -    width:  120px;
   1.625 -}
   1.626 -
   1.627 -table.exceptions table {
   1.628 -    border-spacing: 0;
   1.629 -    border-collapse:    collapse;
   1.630 -    width:  100%;
   1.631 -}
   1.632 -
   1.633 -/* --- TOC --- */
   1.634 -.toc a {
   1.635 -    text-decoration:    none;
   1.636 -}
   1.637 -
   1.638 -a .secno {
   1.639 -    color:  #000;
   1.640 +.caption {
   1.641 +    margin-top: 0.5em;
   1.642 +    font-style:   italic;
   1.643  }
   1.644  
   1.645  /* --- TABLE --- */
   1.646 @@ -697,230 +148,182 @@
   1.647  .section dl.attrs dd, .section dl.eldef dd {
   1.648      margin-bottom:  0;
   1.649  }
   1.650 +</style><style>/* --- ISSUES/NOTES --- */
   1.651 +div.issue-title, div.note-title {
   1.652 +    padding-right:  1em;
   1.653 +    min-width: 7.5em;
   1.654 +    color: #b9ab2d;
   1.655 +}
   1.656 +div.issue-title { color: #e05252; }
   1.657 +div.note-title { color: #52e052; }
   1.658 +div.issue-title span, div.note-title span {
   1.659 +    text-transform: uppercase;
   1.660 +}
   1.661 +div.note, div.issue {
   1.662 +    margin-top: 1em;
   1.663 +    margin-bottom: 1em;
   1.664 +}
   1.665 +.note > p:first-child, .issue > p:first-child { margin-top: 0 }
   1.666 +.issue, .note {
   1.667 +    padding: .5em;
   1.668 +    border-left-width: .5em;
   1.669 +    border-left-style: solid;
   1.670 +}
   1.671 +div.issue, div.note {
   1.672 +    padding: 0.5em;
   1.673 +    margin: 1em 0;
   1.674 +    position: relative;
   1.675 +    clear: both;
   1.676 +}
   1.677 +span.note, span.issue { padding: .1em .5em .15em; }
   1.678  
   1.679 -/* --- EXAMPLES --- */
   1.680 -pre.example {
   1.681 -    border-top: 1px solid #ff4500;
   1.682 -    border-bottom: 1px solid #ff4500;
   1.683 -    padding:    1em;
   1.684 -    margin:     2em 0;
   1.685 +.issue {
   1.686 +    border-color: #e05252;
   1.687 +    background: #fbe9e9;
   1.688 +}
   1.689 +.note {
   1.690 +    border-color: #52e052;
   1.691 +    background: #e9fbe9;
   1.692  }
   1.693  
   1.694 -pre.example::before {
   1.695 -    content:    "Example";
   1.696 -    display:    block;
   1.697 -    width:      150px;
   1.698 -    background: #ff4500;
   1.699 -    color:  #fff;
   1.700 -    font-family:    initial;
   1.701 -    padding:    3px;
   1.702 -    font-weight:    bold;
   1.703 -    margin: -1em 0 1em -1em;
   1.704 +
   1.705 +</style><style>/* HIGHLIGHTS */
   1.706 +code.prettyprint {
   1.707 +    color:  inherit;
   1.708  }
   1.709  
   1.710 -/* --- EDITORIAL NOTES --- */
   1.711 -.issue {
   1.712 -    padding:    1em;
   1.713 -    border: 1px solid #f00;
   1.714 -    background: #ffc;
   1.715 -}
   1.716 -
   1.717 -.issue::before {
   1.718 -    content:    "Issue";
   1.719 -    display:    block;
   1.720 -    width:  150px;
   1.721 -    margin: -1.5em 0 0.5em 0;
   1.722 -    font-weight:    bold;
   1.723 -    border: 1px solid #f00;
   1.724 -    background: #fff;
   1.725 -    padding:    3px 1em;
   1.726 -}
   1.727 -
   1.728 -.note {
   1.729 -    padding:    1em;
   1.730 -    border: 2px solid #cff6d9;
   1.731 -    background: #e2fff0;
   1.732 -}
   1.733 -
   1.734 -.note::before {
   1.735 -    content:    "Note";
   1.736 -    display:    block;
   1.737 -    width:  150px;
   1.738 -    margin: -1.5em 0 0.5em 0;
   1.739 -    font-weight:    bold;
   1.740 -    border: 1px solid #cff6d9;
   1.741 -    background: #fff;
   1.742 -    padding:    3px 1em;
   1.743 -}
   1.744 -
   1.745 -
   1.746 -/* --- SYNTAX HIGHLIGHTING --- */
   1.747 -/* Pretty printing styles. Used with prettify.js. */
   1.748 -.str { color: #080; }
   1.749 -.kwd { color: #008; }
   1.750 -.com { color: #800; }
   1.751 -.typ { color: #606; }
   1.752 -.lit { color: #066; }
   1.753 -.pun { color: #660; }
   1.754 -.pln { color: #000; }
   1.755 -.tag { color: #008; }
   1.756 -.atn { color: #606; }
   1.757 -.atv { color: #080; }
   1.758 -.dec { color: #606; }
   1.759 -/*pre.prettyprint { padding: 2px; border: 1px solid #888 }*/
   1.760 -
   1.761 -/* Specify class=linenums on a pre to get line numbering */
   1.762 -ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
   1.763 -li.L0, li.L1, li.L2, li.L3, li.L5, li.L6, li.L7, li.L8 { list-style-type: none }
   1.764 -/* Alternate shading for lines */
   1.765 -li.L1, li.L3, li.L5, li.L7, li.L9 { background: #eee }
   1.766 -
   1.767 -@media print {
   1.768 -  .str { color: #060; }
   1.769 -  .kwd { color: #006; font-weight: bold; }
   1.770 -  .com { color: #600; font-style: italic; }
   1.771 -  .typ { color: #404; font-weight: bold; }
   1.772 -  .lit { color: #044; }
   1.773 -  .pun { color: #440; }
   1.774 -  .pln { color: #000; }
   1.775 -  .tag { color: #006; font-weight: bold; }
   1.776 -  .atn { color: #404; }
   1.777 -  .atv { color: #060; }
   1.778 -}
   1.779 -</style><link rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" type="text/css" media="all" charset="utf-8"></head>
   1.780 +/* this from google-code-prettify */
   1.781 +.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.782 +</style><link rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/W3C-ED"><!--[if lt IE 9]><script src='undefined://www.w3.org/2008/site/js/html5shiv.js'></script><![endif]--></head>
   1.783  
   1.784    <body><div class="head">
   1.785 -    <p>
   1.786 +  <p>
   1.787  
   1.788        <a href="http://www.w3.org/"><img width="72" height="48" src="http://www.w3.org/Icons/w3c_home" alt="W3C"></a>
   1.789  
   1.790 +  </p>
   1.791 +  <h1 class="title" id="title">Networked Service Discovery and Messaging</h1>
   1.792  
   1.793 -    </p>
   1.794 -    <h1 class="title" id="title" rel="dc:title">Networked Service Discovery and Messaging</h1>
   1.795 +  <h2 id="w3c-editor-s-draft-22-august-2012"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 22 August 2012</h2>
   1.796 +  <dl>
   1.797  
   1.798 -    <h2 id="w3c-editor-s-draft-22-august-2012"><acronym title="World Wide Web Consortium">W3C</acronym> Editor's Draft 22 August 2012</h2>
   1.799 -    <dl>
   1.800 +      <dt>This version:</dt>
   1.801 +      <dd><a href="http://w3c-test.org/dap/discovery-api/">http://w3c-test.org/dap/discovery-api/</a></dd>
   1.802 +      <dt>Latest published version:</dt>
   1.803 +      <dd><a href="http://www.w3.org/TR/discovery-api/">http://www.w3.org/TR/discovery-api/</a></dd>
   1.804  
   1.805 -        <dt>This Version:</dt><dd>   <a href="http://w3c-test.org/dap/discovery-api/">http://w3c-test.org/dap/discovery-api/</a></dd>
   1.806 -        <dt>Latest Published Version:</dt><dd>   <a href="http://www.w3.org/TR/discovery-api/">http://www.w3.org/TR/discovery-api/</a></dd>
   1.807  
   1.808 -          <dt>Latest Editor's Draft:</dt><dd>   <a href="http://w3c-test.org/dap/discovery-api/">http://w3c-test.org/dap/discovery-api/</a></dd>
   1.809 +      <dt>Latest editor's draft:</dt>
   1.810 +      <dd><a href="http://w3c-test.org/dap/discovery-api/">http://w3c-test.org/dap/discovery-api/</a></dd>
   1.811  
   1.812  
   1.813  
   1.814  
   1.815 -          <dt>Previous version:</dt><dd>   <a href="http://www.w3.org/TR/2012/WD-discovery-api-20120807/" rel="dc:replaces">http://www.w3.org/TR/2012/WD-discovery-api-20120807/</a></dd>
   1.816 -
   1.817  
   1.818  
   1.819  
   1.820  
   1.821      <dt>Editors:</dt>
   1.822 +    <dd><span>Rich Tibbett</span>, <a href="http://opera.com/">Opera Software ASA</a></dd>
   1.823 +<dd><span>Clarke Stevens</span>, <a href="http://cablelabs.com/">CableLabs</a></dd>
   1.824  
   1.825 -      <dd class="Editor" rel="bibo:editor"><span typeof="foaf:Person"><span class="name" property="foaf:name">Rich Tibbett</span>,
   1.826  
   1.827 -            <a class="company" href="http://opera.com/" rel="foaf:workplaceHomepage">Opera Software ASA</a>
   1.828 +  </dl>
   1.829  
   1.830  
   1.831  
   1.832  
   1.833 -      </span></dd>
   1.834  
   1.835 -      <dd class="Editor" rel="bibo:editor"><span typeof="foaf:Person"><span class="name" property="foaf:name">Clarke Stevens</span>,
   1.836 +      <p class="copyright">
   1.837 +        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
   1.838 +        2012
   1.839  
   1.840 -            <a class="company" href="http://cablelabs.com/" rel="foaf:workplaceHomepage">CableLabs</a>
   1.841 +        <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
   1.842 +        (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
   1.843 +        <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
   1.844 +        <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.
   1.845 +        <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
   1.846 +        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
   1.847 +        <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
   1.848 +      </p>
   1.849  
   1.850  
   1.851 -
   1.852 -
   1.853 -      </span></dd>
   1.854 -
   1.855 -
   1.856 -
   1.857 -
   1.858 -
   1.859 -
   1.860 -    </dl>
   1.861 -
   1.862 -
   1.863 -
   1.864 -
   1.865 -
   1.866 -    <p class="copyright">
   1.867 -
   1.868 -      <a class="license" href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright" rel="license">Copyright</a> ©
   1.869 -      2012
   1.870 -
   1.871 -      <span rel="dcterms:publisher"><a class="publisher" href="http://www.w3.org/" rel="foaf:homepage" property="foaf:name" content="W3C"><acronym title="World Wide Web Consortium"><acronym title="World Wide Web Consortium">W3C</acronym></acronym></a></span><sup>®</sup>
   1.872 -      (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology"><acronym title="Massachusetts Institute of Technology">MIT</acronym></acronym></a>,
   1.873 -      <a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></acronym></a>,
   1.874 -      <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.
   1.875 -      <acronym title="World Wide Web Consortium">W3C</acronym> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
   1.876 -      <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
   1.877 -      <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
   1.878 -
   1.879 -    </p><hr></div>
   1.880 -    <div id="abstract" class="introductory section" property="dcterms:absract" datatype="" about="#abstract" typeof="bibo:Chapter"><h2>Abstract</h2>
   1.881 +  <hr>
   1.882 +</div>
   1.883 +    <section id="abstract" class="introductory"><h2>Abstract</h2>
   1.884        <p>
   1.885 -        This specification defines a mechanism for an HTML document to discover and subsequently communicate with <acronym title="Hypertext Transfer Protocol"><acronym title="Hypertext Transfer Protocol">HTTP</acronym></acronym>-based services
   1.886 +        This specification defines a mechanism for an HTML document to discover and subsequently communicate with <abbr title="Hypertext Transfer Protocol">HTTP</abbr>-based services
   1.887          advertised via common discovery protocols within a user's network.
   1.888        </p>
   1.889 -    </div><div id="sotd" class="introductory section" about="#sotd" typeof="bibo:Chapter">
   1.890 -      <h2>Status of This Document</h2>
   1.891 -      <p><em>This section describes the status of this document at the time of its publication. Other
   1.892 -      documents may supersede this document. A list of current <acronym title="World Wide Web Consortium">W3C</acronym> publications and the latest revision
   1.893 -      of this technical report can be found in the <a href="http://www.w3.org/TR/"><acronym title="World Wide Web Consortium">W3C</acronym> technical reports
   1.894 -      index</a> at http://www.w3.org/TR/.</em></p>
   1.895 +    </section><section id="sotd" class="introductory"><h2>Status of This Document</h2>
   1.896 +
   1.897 +
   1.898 +
   1.899 +        <p>
   1.900 +          <em>This section describes the status of this document at the time of its publication. Other
   1.901 +          documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision
   1.902 +          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.903 +          index</a> at http://www.w3.org/TR/.</em>
   1.904 +        </p>
   1.905  
   1.906        <p>
   1.907          This document represents the early consensus of the group on the scope and features of the proposed
   1.908 -        <acronym title="Application Programming Interface">API</acronym>.
   1.909 -      </p>
   1.910 -
   1.911 -      <p>
   1.912 -        This document was published by the <a href="http://www.w3.org/2009/dap/">Device APIs and Policy Working Group</a> as
   1.913 -        a
   1.914 -        Editor's Draft.
   1.915 -         This document is intended to become a <acronym title="World Wide Web Consortium">W3C</acronym> Recommendation.
   1.916 -        If you wish to make comments regarding this document, please send them to
   1.917 -        <a href="mailto:public-device-apis@w3.org">public-device-apis@w3.org</a>
   1.918 -        (<a href="mailto:public-device-apis-request@w3.org?subject=subscribe">subscribe</a>,
   1.919 -        <a href="http://lists.w3.org/Archives/Public/public-device-apis/">archives</a>).
   1.920 -
   1.921 -
   1.922 -        All feedback is welcome.
   1.923 +        <abbr title="Application Programming Interface">API</abbr>.
   1.924        </p>
   1.925  
   1.926          <p>
   1.927 -          Publication as a Editor's Draft does not imply endorsement by the <acronym title="World Wide Web Consortium">W3C</acronym> Membership. This is a draft
   1.928 -          document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate
   1.929 -          to cite this document as other than work in progress.
   1.930 +          This document was published by the <a href="http://www.w3.org/2009/dap/">Device APIs and Policy Working Group</a> as an Editor's Draft.
   1.931 +
   1.932 +          If you wish to make comments regarding this document, please send them to
   1.933 +          <a href="mailto:public-device-apis@w3.org">public-device-apis@w3.org</a>
   1.934 +          (<a href="mailto:public-device-apis-request@w3.org?subject=subscribe">subscribe</a>,
   1.935 +          <a href="http://lists.w3.org/Archives/Public/public-device-apis/">archives</a>).
   1.936 +
   1.937 +
   1.938 +          All feedback is welcome.
   1.939          </p>
   1.940  
   1.941 +          <p>
   1.942 +            Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership.
   1.943 +            This is a draft document and may be updated, replaced or obsoleted by other documents at
   1.944 +            any time. It is inappropriate to cite this document as other than work in progress.
   1.945 +          </p>
   1.946  
   1.947 -      <p>
   1.948 -        This document was produced by a group operating under the
   1.949 -        <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <acronym title="World Wide Web Consortium">W3C</acronym> Patent Policy</a>.
   1.950  
   1.951 -        <acronym title="World Wide Web Consortium">W3C</acronym> maintains a <a href="http://www.w3.org/2004/01/pp-impl/43696/status" rel="disclosure">public list of any patent disclosures</a>
   1.952 -        made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An
   1.953 -        individual who has actual knowledge of a patent which the individual believes contains
   1.954 -        <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
   1.955 -        information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
   1.956 -        6 of the <acronym title="World Wide Web Consortium">W3C</acronym> Patent Policy</a>.
   1.957 -      </p>
   1.958 -    </div><div id="toc" about="#toc" typeof="bibo:Chapter" class="section"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">2. </span>Conformance</a><ul class="toc"><li class="tocline"><a href="#dependencies" class="tocxref"><span class="secno">2.1 </span>Dependencies</a></li></ul></li><li class="tocline"><a href="#terminology" class="tocxref"><span class="secno">3. </span>Terminology</a></li><li class="tocline"><a href="#requesting-networked-services" class="tocxref"><span class="secno">4. </span>Requesting networked services</a><ul class="toc"><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">4.1 </span>Methods</a></li><li class="tocline"><a href="#error-handling" class="tocxref"><span class="secno">4.2 </span>Error Handling</a></li></ul></li><li class="tocline"><a href="#obtaining-networked-services" class="tocxref"><span class="secno">5. </span>Obtaining networked services</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">5.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">5.2 </span>Methods</a></li><li class="tocline"><a href="#events" class="tocxref"><span class="secno">5.3 </span>Events</a></li></ul></li><li class="tocline"><a href="#communicating-with-a-networked-service" class="tocxref"><span class="secno">6. </span>Communicating with a networked service</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">6.1 </span>Attributes</a></li><li class="tocline"><a href="#states" class="tocxref"><span class="secno">6.2 </span>States</a></li><li class="tocline"><a href="#events-1" class="tocxref"><span class="secno">6.3 </span>Events</a></li></ul></li><li class="tocline"><a href="#service-discovery" class="tocxref"><span class="secno">7. </span>Service Discovery</a><ul class="toc"><li class="tocline"><a href="#zeroconf--mdns---dns-sd" class="tocxref"><span class="secno">7.1 </span>Zeroconf (<acronym title="Multicast DNS"><acronym title="Multicast DNS">mDNS</acronym></acronym> + <acronym title="Domain Name System"><acronym title="Domain Name System">DNS</acronym></acronym>-<acronym title="Service Discovery"><acronym title="Service Discovery">SD</acronym></acronym>)</a></li><li class="tocline"><a href="#universal-plug-and-play--upnp" class="tocxref"><span class="secno">7.2 </span>Universal Plug-and-Play (<acronym title="Universal Plug-and-Play"><acronym title="Universal Plug-and-Play">UPnP</acronym></acronym>)</a></li><li class="tocline"><a href="#network-topology-monitoring" class="tocxref"><span class="secno">7.3 </span>Network Topology Monitoring</a></li></ul></li><li class="tocline"><a href="#garbage-collection" class="tocxref"><span class="secno">8. </span>Garbage collection</a></li><li class="tocline"><a href="#use-cases-and-requirements" class="tocxref"><span class="secno">9. </span>Use Cases and Requirements</a></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">A. </span>Examples</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">B. </span>Acknowledgements</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">C. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">C.1 </span>Normative references</a></li></ul></li></ul></div>
   1.959 +        <p>
   1.960  
   1.961 +            This document was produced by a group operating under the
   1.962 +            <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.963  
   1.964  
   1.965 -    <div class="informative section" id="introduction" about="#introduction" typeof="bibo:Chapter">
   1.966 -      <!--OddPage--><h2><span class="secno">1. </span>Introduction</h2><em>This section is non-normative.</em>
   1.967  
   1.968 -      <p>To enable Web pages to connect and communicate with Local-networked Services provided over <acronym title="Hypertext Transfer Protocol">HTTP</acronym>, this specification introduces the
   1.969 +
   1.970 +              <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.971 +
   1.972 +            made in connection with the deliverables of the group; that page also includes instructions for
   1.973 +            disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains
   1.974 +            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
   1.975 +            information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
   1.976 +            6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
   1.977 +
   1.978 +
   1.979 +        </p>
   1.980 +
   1.981 +
   1.982 +
   1.983 +
   1.984 +</section><section id="toc"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#conformance" class="tocxref"><span class="secno">2. </span>Conformance</a><ul class="toc"><li class="tocline"><a href="#dependencies" class="tocxref"><span class="secno">2.1 </span>Dependencies</a></li></ul></li><li class="tocline"><a href="#terminology" class="tocxref"><span class="secno">3. </span>Terminology</a></li><li class="tocline"><a href="#requesting-networked-services" class="tocxref"><span class="secno">4. </span>Requesting networked services</a><ul class="toc"><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">4.1 </span>Methods</a></li><li class="tocline"><a href="#error-handling" class="tocxref"><span class="secno">4.2 </span>Error Handling</a></li></ul></li><li class="tocline"><a href="#obtaining-networked-services" class="tocxref"><span class="secno">5. </span>Obtaining networked services</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">5.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">5.2 </span>Methods</a></li><li class="tocline"><a href="#events" class="tocxref"><span class="secno">5.3 </span>Events</a></li></ul></li><li class="tocline"><a href="#communicating-with-a-networked-service" class="tocxref"><span class="secno">6. </span>Communicating with a networked service</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">6.1 </span>Attributes</a></li><li class="tocline"><a href="#states" class="tocxref"><span class="secno">6.2 </span>States</a></li><li class="tocline"><a href="#events-1" class="tocxref"><span class="secno">6.3 </span>Events</a></li></ul></li><li class="tocline"><a href="#service-discovery" class="tocxref"><span class="secno">7. </span>Service Discovery</a><ul class="toc"><li class="tocline"><a href="#zeroconf-mdns-dns-sd" class="tocxref"><span class="secno">7.1 </span>Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)</a></li><li class="tocline"><a href="#universal-plug-and-play-upnp" class="tocxref"><span class="secno">7.2 </span>Universal Plug-and-Play (<abbr title="Universal Plug-and-Play">UPnP</abbr>)</a></li><li class="tocline"><a href="#network-topology-monitoring" class="tocxref"><span class="secno">7.3 </span>Network Topology Monitoring</a></li></ul></li><li class="tocline"><a href="#garbage-collection" class="tocxref"><span class="secno">8. </span>Garbage collection</a></li><li class="tocline"><a href="#use-cases-and-requirements" class="tocxref"><span class="secno">9. </span>Use Cases and Requirements</a></li><li class="tocline"><a href="#examples" class="tocxref"><span class="secno">A. </span>Examples</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">B. </span>Acknowledgements</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">C. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">C.1 </span>Normative references</a></li><li class="tocline"><a href="#informative-references" class="tocxref"><span class="secno">C.2 </span>Informative references</a></li></ul></li></ul></section>
   1.985 +
   1.986 +
   1.987 +
   1.988 +    <section class="informative" id="introduction">
   1.989 +      <!--OddPage--><h2><span class="secno">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p>
   1.990 +
   1.991 +      <p>To enable Web pages to connect and communicate with Local-networked Services provided over <abbr title="Hypertext Transfer Protocol">HTTP</abbr>, this specification introduces the
   1.992        <a href="#navigatornetworkservice"><code>NavigatorNetworkService</code></a> interface.</p>
   1.993  
   1.994        <p>
   1.995 -         Using this <acronym title="Application Programming Interface"><acronym title="Application Programming Interface">API</acronym></acronym> consists of requesting a well-known service type, known by developers and advertised by Local-networked Devices. User authorization, where the user connects the web page to one or more discovered services,
   1.996 +         Using this <abbr title="Application Programming Interface">API</abbr> consists of requesting a well-known service type, known by developers and advertised by Local-networked Devices. User authorization, where the user connects the web page to one or more discovered services,
   1.997           is expected before the web page is able to interact with any Local-networked Services.
   1.998        </p>
   1.999  
  1.1000 @@ -940,41 +343,66 @@
  1.1001  
  1.1002        <p>
  1.1003           Once connected to a Local-networked Service the Web page can send requests and receive responses to the Local-networked Service via the messaging format and appropriate channel inferred from the service type
  1.1004 -         authorized via the provided <acronym title="Application Programming Interface">API</acronym>.
  1.1005 +         authorized via the provided <abbr title="Application Programming Interface">API</abbr>.
  1.1006           The Web page, once connected, can also receive service-pushed events, in the messaging format supported by the Local-networked Device, if such event subscription functionality is provided by the
  1.1007           connected Local-networked Service.
  1.1008        </p>
  1.1009  
  1.1010        <div class="example">
  1.1011 -       <p>Example of requesting a <acronym title="Domain Name System">DNS</acronym>-<acronym title="Service Discovery">SD</acronym> advertised service:</p>
  1.1012 +       <p>Example of requesting a <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> advertised service:</p>
  1.1013         <hr>
  1.1014 -       <div><div id="highlighter_667967" class="syntaxhighlighter nogutter  js"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="js keyword">function</code> <code class="js plain">showServices( services ) {</code></div><div class="line number2 index1 alt1"><code class="js spaces">&nbsp;&nbsp;</code><code class="js comments">// Show a list of all the services provided to the web page</code></div><div class="line number3 index2 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js keyword">for</code><code class="js plain">(</code><code class="js keyword">var</code> <code class="js plain">i = 0, l = services.length; i &lt; l; i++) console.log( services[i].name );</code></div><div class="line number4 index3 alt1"><code class="js plain">}</code></div><div class="line number5 index4 alt2">&nbsp;</div><div class="line number6 index5 alt1"><code class="js plain">navigator.getNetworkServices(</code><code class="js string">'zeroconf:_boxee-jsonrpc._tcp'</code><code class="js plain">, showServices);</code></div></div></td></tr></tbody></table></div></div>
  1.1015 +       <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.1016 +  </span><span class="com">// Show a list of all the services provided to the web page</span><span class="pln">
  1.1017 +  </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.1018 +</span><span class="pun">}</span><span class="pln">
  1.1019 +
  1.1020 +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.1021        </div>
  1.1022  
  1.1023        <div class="example">
  1.1024 -        <p>Example of requesting a <acronym title="Universal Plug-and-Play">UPnP</acronym> advertised service, also handling error conditions:</p>
  1.1025 +        <p>Example of requesting a <abbr title="Universal Plug-and-Play">UPnP</abbr> advertised service, also handling error conditions:</p>
  1.1026          <hr>
  1.1027 -        <div><div id="highlighter_95512" class="syntaxhighlighter nogutter  js"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="js keyword">function</code> <code class="js plain">showServices( services ) {</code></div><div class="line number2 index1 alt1"><code class="js spaces">&nbsp;&nbsp;</code><code class="js comments">// Show a list of all the services provided to the web page</code></div><div class="line number3 index2 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js keyword">for</code><code class="js plain">(</code><code class="js keyword">var</code> <code class="js plain">i = 0, l = services.length; i &lt; l; i++) console.log( services[i].name );</code></div><div class="line number4 index3 alt1"><code class="js plain">}</code></div><div class="line number5 index4 alt2">&nbsp;</div><div class="line number6 index5 alt1"><code class="js keyword">function</code> <code class="js plain">error( e ) {</code></div><div class="line number7 index6 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">console.log( </code><code class="js string">"Error occurred: "</code> <code class="js plain">+ e.code );</code></div><div class="line number8 index7 alt1"><code class="js plain">}</code></div><div class="line number9 index8 alt2">&nbsp;</div><div class="line number10 index9 alt1"><code class="js plain">navigator.getNetworkServices(</code><code class="js string">'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'</code><code class="js plain">, showServices, error);</code></div></div></td></tr></tbody></table></div></div>
  1.1028 +        <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.1029 +  </span><span class="com">// Show a list of all the services provided to the web page</span><span class="pln">
  1.1030 +  </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.1031 +</span><span class="pun">}</span><span class="pln">
  1.1032 +
  1.1033 +</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.1034 +  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.1035 +</span><span class="pun">}</span><span class="pln">
  1.1036 +
  1.1037 +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.1038        </div>
  1.1039  
  1.1040        <div class="example">
  1.1041 -        <p>Example of requesting either a <acronym title="Domain Name System">DNS</acronym>-<acronym title="Service Discovery">SD</acronym> or <acronym title="Universal Plug-and-Play">UPnP</acronym> advertised service:</p>
  1.1042 +        <p>Example of requesting either a <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> or <abbr title="Universal Plug-and-Play">UPnP</abbr> advertised service:</p>
  1.1043          <hr>
  1.1044 -        <div><div id="highlighter_135617" class="syntaxhighlighter nogutter  js"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="js keyword">function</code> <code class="js plain">showServices( services ) {</code></div><div class="line number2 index1 alt1"><code class="js spaces">&nbsp;&nbsp;</code><code class="js comments">// Show a list of all the services provided to the web page (+ service type)</code></div><div class="line number3 index2 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js keyword">for</code><code class="js plain">(</code><code class="js keyword">var</code> <code class="js plain">i = 0, l = services.length; i &lt; l; i++)</code></div><div class="line number4 index3 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">console.log( services[i].name + </code><code class="js string">'('</code> <code class="js plain">+ services[i].type + </code><code class="js string">')'</code> <code class="js plain">);</code></div><div class="line number5 index4 alt2"><code class="js plain">}</code></div><div class="line number6 index5 alt1">&nbsp;</div><div class="line number7 index6 alt2"><code class="js plain">navigator.getNetworkServices([</code></div><div class="line number8 index7 alt1"><code class="js spaces">&nbsp;&nbsp;</code><code class="js string">'zeroconf:_boxee-jsonrpc._tcp'</code><code class="js plain">,</code></div><div class="line number9 index8 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js string">'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'</code></div><div class="line number10 index9 alt1"><code class="js plain">], showServices);</code></div></div></td></tr></tbody></table></div></div>
  1.1045 +        <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.1046 +  </span><span class="com">// Show a list of all the services provided to the web page (+ service type)</span><span class="pln">
  1.1047 +  </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.1048 +     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.1049 +</span><span class="pun">}</span><span class="pln">
  1.1050 +
  1.1051 +navigator</span><span class="pun">.</span><span class="pln">getNetworkServices</span><span class="pun">([</span><span class="pln">
  1.1052 +  </span><span class="str">'zeroconf:_boxee-jsonrpc._tcp'</span><span class="pun">,</span><span class="pln">
  1.1053 +  </span><span class="str">'upnp:urn:schemas-upnp-org:service:ContentDirectory:1'</span><span class="pln">
  1.1054 +</span><span class="pun">],</span><span class="pln"> showServices</span><span class="pun">);</span></pre>
  1.1055        </div>
  1.1056  
  1.1057 -      <p>For more detailed examples see the <a href="#examples" class="sec-ref">Examples</a> section.
  1.1058 -    </p></div>
  1.1059 +      <p>For more detailed examples see the <a href="#examples">Examples</a> section.
  1.1060 +    </p></section>
  1.1061  
  1.1062 -    <div id="conformance" about="#conformance" typeof="bibo:Chapter" class="section"><!--OddPage--><h2><span class="secno">2. </span>Conformance</h2><p>
  1.1063 -    As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,
  1.1064 -    and notes in this specification are non-normative. Everything else in this specification is
  1.1065 -    normative.
  1.1066 -  </p>
  1.1067 -  <p>
  1.1068 -    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.1069 -    and <em class="rfc2119" title="optional">optional</em> in this specification are to be interpreted as described in [<cite><a class="bibref" rel="biblioentry" href="#bib-RFC2119">RFC2119</a></cite>].
  1.1070 -  </p>
  1.1071 +    <section id="conformance"><!--OddPage--><h2><span class="secno">2. </span>Conformance</h2>
  1.1072 +<p>
  1.1073 +  As well as sections marked as non-normative, all authoring guidelines, diagrams, examples,
  1.1074 +  and notes in this specification are non-normative. Everything else in this specification is
  1.1075 +  normative.
  1.1076 +</p>
  1.1077 +<p>
  1.1078 +  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.1079 +  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.1080 +</p>
  1.1081 +
  1.1082  
  1.1083       <p>Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or "return false and abort these steps") are to be interpreted with the
  1.1084       meaning of the key word ("must", "should", "may", etc) used in introducing the algorithm.</p>
  1.1085 @@ -1004,21 +432,21 @@
  1.1086        is insufficient.
  1.1087       </p>
  1.1088  
  1.1089 -      <section id="dependencies" about="#dependencies" typeof="bibo:Chapter">
  1.1090 +      <section id="dependencies">
  1.1091           <h3><span class="secno">2.1 </span>Dependencies</h3>
  1.1092  
  1.1093           This specification relies on several other underlying specifications.
  1.1094  
  1.1095           <dl>
  1.1096              <dt>HTML</dt>
  1.1097 -            <dd>Many fundamental concepts from HTML are used by this specification. [<cite><a class="bibref" rel="biblioentry" href="#bib-HTML5">HTML5</a></cite>]</dd>
  1.1098 +            <dd>Many fundamental concepts from HTML are used by this specification. [<cite><a class="bibref" href="#bib-HTML5">HTML5</a></cite>]</dd>
  1.1099              <dt>WebIDL</dt>
  1.1100 -            <dd>The IDL blocks in this specification use the semantics of the WebIDL specification. [<cite><a class="bibref" rel="biblioentry" href="#bib-WEBIDL">WEBIDL</a></cite>]</dd>
  1.1101 +            <dd>The IDL blocks in this specification use the semantics of the WebIDL specification. [<cite><a class="bibref" href="#bib-WEBIDL">WEBIDL</a></cite>]</dd>
  1.1102           </dl>
  1.1103        </section>
  1.1104 -    </div>
  1.1105 +    </section>
  1.1106  
  1.1107 -    <div id="terminology" about="#terminology" typeof="bibo:Chapter" class="section">
  1.1108 +    <section id="terminology">
  1.1109        <!--OddPage--><h2><span class="secno">3. </span>Terminology</h2>
  1.1110  
  1.1111        <p>
  1.1112 @@ -1026,8 +454,8 @@
  1.1113        </p>
  1.1114  
  1.1115        <p>
  1.1116 -         The term DOM is used to refer to the <acronym title="Application Programming Interface">API</acronym> set made available to scripts in Web applications, and does not necessarily imply the existence of an actual <code>Document</code> object or of any
  1.1117 -         other <code>Node</code> objects as defined in the DOM Core specifications. [<cite><a class="bibref" rel="biblioentry" href="#bib-DOM-CORE">DOM-CORE</a></cite>]
  1.1118 +         The term DOM is used to refer to the <abbr title="Application Programming Interface">API</abbr> set made available to scripts in Web applications, and does not necessarily imply the existence of an actual <code>Document</code> object or of any
  1.1119 +         other <code>Node</code> objects as defined in the DOM Core specifications. [<cite><a class="bibref" href="#bib-DOM4">DOM4</a></cite>]
  1.1120        </p>
  1.1121  
  1.1122        <p>
  1.1123 @@ -1041,9 +469,9 @@
  1.1124        <p>
  1.1125          A <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> provided in the <code>type</code> attribute of the <code>getNetworkServices()</code> method will be matched against the services currently contained in the <a href="#dfn-list-of-available-service-records" class="internalDFN">list of available service records</a> according to the algorithms defined in this specification.
  1.1126        </p>
  1.1127 -    </div>
  1.1128 +    </section>
  1.1129  
  1.1130 -    <div id="requesting-networked-services" about="#requesting-networked-services" typeof="bibo:Chapter" class="section">
  1.1131 +    <section id="requesting-networked-services">
  1.1132       <!--OddPage--><h2><span class="secno">4. </span>Requesting networked services</h2>
  1.1133  
  1.1134  
  1.1135 @@ -1074,7 +502,7 @@
  1.1136  };
  1.1137  </pre>
  1.1138  
  1.1139 -  <section id="methods" about="#methods" typeof="bibo:Chapter">
  1.1140 +  <section id="methods">
  1.1141     <h3><span class="secno">4.1 </span>Methods</h3>
  1.1142  
  1.1143        <dl class="domintro">
  1.1144 @@ -1225,10 +653,10 @@
  1.1145  
  1.1146                 <ol class="rule">
  1.1147                    <li>
  1.1148 -                     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 <acronym title="Uniform Resource Locator"><acronym title="Uniform Resource Locator">URL</acronym></acronym> whitelist</a>.
  1.1149 +                     Add the <var>service</var>'s <code>url</code> parameter to the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
  1.1150                    </li>
  1.1151                    <li>
  1.1152 -                    If <var>service</var>'s <code>type</code> parameter begins with the DOMString "<code>upnp:</code>" and the <var>service</var>'s <code>eventsUrl</code> parameter is not empty then <a href="#dfn-setup-a-upnp-events-subscription" class="internalDFN">setup a <acronym title="Universal Plug-and-Play">UPnP</acronym> Events Subscription</a> for <var>service</var>.
  1.1153 +                    If <var>service</var>'s <code>type</code> parameter begins with the DOMString "<code>upnp:</code>" and the <var>service</var>'s <code>eventsUrl</code> parameter is not empty then <a href="#dfn-setup-a-upnp-events-subscription" class="internalDFN">setup a <abbr title="Universal Plug-and-Play">UPnP</abbr> Events Subscription</a> for <var>service</var>.
  1.1154                    </li>
  1.1155                 </ol>
  1.1156              </li>
  1.1157 @@ -1260,7 +688,7 @@
  1.1158  
  1.1159            <p>
  1.1160              When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> add the <code>url</code> property
  1.1161 -             to the <dfn id="dfn-entry-script-origin-s-url-whitelist">entry script origin's <acronym title="Uniform Resource Locator">URL</acronym> whitelist</dfn>. This list enables the
  1.1162 +             to the <dfn id="dfn-entry-script-origin-s-url-whitelist">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</dfn>. This list enables the
  1.1163              Web page to override and initiate cross-site resource requests towards these URLs, and any sub-resources of these URLs, within the current
  1.1164              <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script" class="externalDFN">entry script</a>'s
  1.1165              <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.1166 @@ -1268,7 +696,7 @@
  1.1167           </p>
  1.1168  
  1.1169           <p>
  1.1170 -            If the user navigates away from the current browsing context, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> remove all previously whitelisted urls from the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <acronym title="Uniform Resource Locator">URL</acronym> whitelist</a>.
  1.1171 +            If the user navigates away from the current browsing context, the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</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.1172              There is no persistence to network service selections provided to a web page. It is not possible to access a previously white-listed networked service without the necessary user authorization in all of the following cases:
  1.1173              </p><ul>
  1.1174                <li>If the current script is reloaded at any point in the same or different window.</li>
  1.1175 @@ -1281,7 +709,7 @@
  1.1176        </div>
  1.1177        </section>
  1.1178  
  1.1179 -      <section id="error-handling" about="#error-handling" typeof="bibo:Chapter">
  1.1180 +      <section id="error-handling">
  1.1181           <h3><span class="secno">4.2 </span>Error Handling</h3>
  1.1182  
  1.1183        <dl class="domintro">
  1.1184 @@ -1312,7 +740,7 @@
  1.1185                 <dfn id="dom-navigatornetworkserviceerror-permission_denied" title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn> (numeric value 1)
  1.1186              </dt>
  1.1187              <dd>
  1.1188 -               The user denied the page permission to access any services.
  1.1189 +               The user or user agent denied the page permission to access any services.
  1.1190              </dd>
  1.1191              <dt>
  1.1192                 <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix" title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn> (numeric value 2)
  1.1193 @@ -1324,8 +752,8 @@
  1.1194  
  1.1195        </section>
  1.1196  
  1.1197 -      </div>
  1.1198 -      <div id="obtaining-networked-services" about="#obtaining-networked-services" typeof="bibo:Chapter" class="section">
  1.1199 +      </section>
  1.1200 +      <section id="obtaining-networked-services">
  1.1201        <!--OddPage--><h2><span class="secno">5. </span>Obtaining networked services</h2>
  1.1202  
  1.1203        <p>
  1.1204 @@ -1349,7 +777,7 @@
  1.1205  <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.1206  </pre>
  1.1207  
  1.1208 -      <section id="attributes" about="#attributes" typeof="bibo:Chapter">
  1.1209 +      <section id="attributes">
  1.1210        <h3><span class="secno">5.1 </span>Attributes</h3>
  1.1211  
  1.1212          <dl class="domintro">
  1.1213 @@ -1404,7 +832,7 @@
  1.1214  
  1.1215        </section>
  1.1216  
  1.1217 -      <section id="methods-1" about="#methods-1" typeof="bibo:Chapter">
  1.1218 +      <section id="methods-1">
  1.1219        <h3><span class="secno">5.2 </span>Methods</h3>
  1.1220          <dl class="domintro">
  1.1221          <dt>
  1.1222 @@ -1444,9 +872,9 @@
  1.1223          A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current list of zero or more <a href="#current_authorized_services" class="internalDFN">current authorized services</a>, of which zero or more can be available at a time. Each item in <a href="#current_authorized_services" class="internalDFN">current authorized services</a> is represented by a <a href="#networkservice"><code>NetworkService</code></a> object. The list of <a href="#current_authorized_services" class="internalDFN">current authorized services</a> is <span>immutable</span> meaning that it cannot be modified for the lifetime of a <a href="#networkservices"><code>NetworkServices</code></a> object.
  1.1224        </p>
  1.1225  
  1.1226 -      <p class="note">
  1.1227 +      <div class="note"><div class="note-title"><span>Note</span></div><p class="">
  1.1228          Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the first has the index 0, and each subsequent service is numbered one higher than the previous one. If the <a href="#dfn-user-agent" class="internalDFN">user agent</a> dynamically adds or removes network services for any reason, then the indices of the services in <a href="#current_authorized_services" class="internalDFN">current authorized services</a> will change dynamically. If the set of network services changes entirely, then all the previous services will be removed from <a href="#current_authorized_services" class="internalDFN">current authorized services</a> and replaced with new services.
  1.1229 -      </p>
  1.1230 +      </p></div>
  1.1231  
  1.1232        <p>
  1.1233          The <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices" class="externalDFN">supported property indices</a> of <a href="#networkservices"><code>NetworkServices</code></a> objects at any instant are the numbers from zero to the number of items in <a href="#current_authorized_services" class="internalDFN">current authorized services</a> represented by the respective object minus one, if any services are represented in <a href="#current_authorized_services" class="internalDFN">current authorized services</a>. If a <a href="#networkservices"><code>NetworkServices</code></a> object represents no <a href="#current_authorized_services" class="internalDFN">current authorized services</a>, it has no <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices" class="externalDFN">supported property indices</a>.
  1.1234 @@ -1469,7 +897,7 @@
  1.1235  
  1.1236        </section>
  1.1237  
  1.1238 -      <section id="events" about="#events" typeof="bibo:Chapter">
  1.1239 +      <section id="events">
  1.1240        <h3><span class="secno">5.3 </span>Events</h3>
  1.1241  
  1.1242        <p>
  1.1243 @@ -1517,12 +945,12 @@
  1.1244  
  1.1245        </section>
  1.1246  
  1.1247 -    </div>
  1.1248 -    <div id="communicating-with-a-networked-service" about="#communicating-with-a-networked-service" typeof="bibo:Chapter" class="section">
  1.1249 +    </section>
  1.1250 +    <section id="communicating-with-a-networked-service">
  1.1251      <!--OddPage--><h2><span class="secno">6. </span>Communicating with a networked service</h2>
  1.1252  
  1.1253  <p>
  1.1254 -   The <a href="#networkservice"><code>NetworkService</code></a> interface is used to provide a set of connection information for an <acronym title="Hypertext Transfer Protocol">HTTP</acronym> service endpoint and if available, service events, running on a networked device.
  1.1255 +   The <a href="#networkservice"><code>NetworkService</code></a> interface is used to provide a set of connection information for an <abbr title="Hypertext Transfer Protocol">HTTP</abbr> service endpoint and if available, service events, running on a networked device.
  1.1256  </p>
  1.1257  
  1.1258  <pre class="widl">[NoInterfaceObject]
  1.1259 @@ -1545,7 +973,7 @@
  1.1260  <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.1261  </pre>
  1.1262  
  1.1263 -<section id="attributes-1" about="#attributes-1" typeof="bibo:Chapter">
  1.1264 +<section id="attributes-1">
  1.1265    <h3><span class="secno">6.1 </span>Attributes</h3>
  1.1266  
  1.1267        <dl class="domintro">
  1.1268 @@ -1594,7 +1022,7 @@
  1.1269          </dt>
  1.1270          <dd>
  1.1271            <p>
  1.1272 -            The control <acronym title="Uniform Resource Locator">URL</acronym> endpoint (including any required port information) of the user-selected control service that has been added to the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <acronym title="Uniform Resource Locator">URL</acronym> whitelist</a>.
  1.1273 +            The control <abbr title="Uniform Resource Locator">URL</abbr> endpoint (including any required port information) of the user-selected control service that has been added to the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>.
  1.1274            </p>
  1.1275          </dd>
  1.1276          <dt>
  1.1277 @@ -1612,7 +1040,7 @@
  1.1278        </dl>
  1.1279  
  1.1280            <p>
  1.1281 -            The <dfn id="dom-networkservice-id"><code>id</code></dfn> attribute is a unique identifier for the service. Two services provided at different times or on different objects <em class="rfc2119" title="must">must</em> have the same <a href="#dom-networkservice-id"><code>id</code></a> value.
  1.1282 +            The <dfn id="dom-networkservice-id"><code>id</code></dfn> attribute is a unique identifier for the service. The same service provided at different times or on different objects <em class="rfc2119" title="must">must</em> have the same <a href="#dom-networkservice-id"><code>id</code></a> value.
  1.1283           </p>
  1.1284  
  1.1285           <p>
  1.1286 @@ -1624,8 +1052,8 @@
  1.1287            </p>
  1.1288  
  1.1289           <p>
  1.1290 -            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 <acronym title="Uniform Resource Locator">URL</acronym></a> pointing to the root <acronym title="Hypertext Transfer Protocol">HTTP</acronym>
  1.1291 -            endpoint for the service that has been added to the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <acronym title="Uniform Resource Locator">URL</acronym> whitelist</a>. Web pages can subsequently use this value for implicit cross-document messaging via various existing mechanisms (e.g. Web Sockets, Server-Sent Events, Web Messaging, XMLHttpRequest).
  1.1292 +            The <dfn id="dom-networkservice-url"><code>url</code></dfn> attribute is an <a href="http://www.w3.org/TR/html5/urls.html#absolute-url" class="externalDFN">absolute <abbr title="Uniform Resource Locator">URL</abbr></a> pointing to the root <abbr title="Hypertext Transfer Protocol">HTTP</abbr>
  1.1293 +            endpoint for the service that has been added to the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <abbr title="Uniform Resource Locator">URL</abbr> whitelist</a>. Web pages can subsequently use this value for implicit cross-document messaging via various existing mechanisms (e.g. Web Sockets, Server-Sent Events, Web Messaging, XMLHttpRequest).
  1.1294           </p>
  1.1295  
  1.1296           <p>
  1.1297 @@ -1634,7 +1062,7 @@
  1.1298  
  1.1299        </section>
  1.1300  
  1.1301 -      <section id="states" about="#states" typeof="bibo:Chapter">
  1.1302 +      <section id="states">
  1.1303           <h3><span class="secno">6.2 </span>States</h3>
  1.1304  
  1.1305        <dl class="domintro">
  1.1306 @@ -1653,13 +1081,13 @@
  1.1307        </dl>
  1.1308  
  1.1309        <p>
  1.1310 -        The <dfn id="dom-networkservice-config"><code>online</code></dfn> attribute indicates whether the service is reporting itself as being
  1.1311 +        The <dfn id="dom-networkservice-online"><code>online</code></dfn> attribute indicates whether the service is reporting itself as being
  1.1312          either <var>online</var>, and therefore accessible on the local network, in which case this attribute will return <code>true</code> or, <var>offline</var>, and therefore not accessible on the local network, either temporarily or permanently, in which case this attribute will return <code>false</code>. This attribute <em class="rfc2119" title="must">must</em> default to <code>true</code>.
  1.1313        </p>
  1.1314  
  1.1315        </section>
  1.1316  
  1.1317 -      <section id="events-1" about="#events-1" typeof="bibo:Chapter">
  1.1318 +      <section id="events-1">
  1.1319           <h3><span class="secno">6.3 </span>Events</h3>
  1.1320  
  1.1321        <p>
  1.1322 @@ -1701,7 +1129,7 @@
  1.1323            </tr>
  1.1324            <tr>
  1.1325              <td>
  1.1326 -              <dfn id="dom-networkservice-offserviceoffline" title="dom-NetworkService-onserviceoffline">
  1.1327 +              <dfn id="dom-networkservice-onserviceoffline" title="dom-NetworkService-onserviceoffline">
  1.1328                  <code>onserviceoffline</code>
  1.1329                </dfn>
  1.1330              </td>
  1.1331 @@ -1717,14 +1145,14 @@
  1.1332        </p>
  1.1333  
  1.1334        </section>
  1.1335 -   </div>
  1.1336 +   </section>
  1.1337  
  1.1338 -      <div id="service-discovery" about="#service-discovery" typeof="bibo:Chapter" class="section">
  1.1339 +      <section id="service-discovery">
  1.1340              <!--OddPage--><h2><span class="secno">7. </span>Service Discovery</h2>
  1.1341  
  1.1342        <p>
  1.1343 -         A <a href="#dfn-user-agent" class="internalDFN">user agent</a> conforming to this specification <em class="rfc2119" title="may">may</em> implement <acronym title="Simple Service Discovery Protocol"><acronym title="Simple Service Discovery Protocol">SSDP</acronym></acronym> [<cite><a class="bibref" rel="biblioentry" href="#bib-UPNP">UPNP</a></cite>] and Zeroconf [<cite><a class="bibref" rel="biblioentry" href="#bib-DNS-SD">DNS-SD</a></cite>] + [<cite><a class="bibref" rel="biblioentry" href="#bib-MDNS">MDNS</a></cite>] service discovery mechanisms
  1.1344 -         to enable Web pages to request and connect with <acronym title="Hypertext Transfer Protocol">HTTP</acronym> services running on networked devices, discovered via either mechanism, through this <acronym title="Application Programming Interface">API</acronym>. When a <a href="#dfn-user-agent" class="internalDFN">user agent</a> implements either of these service discovery mechanisms, then it <em class="rfc2119" title="must">must</em> conform to the corresponding algorithms provided in this section of the specification.
  1.1345 +         A <a href="#dfn-user-agent" class="internalDFN">user agent</a> conforming to this specification <em class="rfc2119" title="may">may</em> implement <acronym title="Simple Service Discovery Protocol">SSDP</acronym> [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] and Zeroconf [<cite><a class="bibref" href="#bib-DNS-SD">DNS-SD</a></cite>] + [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>] service discovery mechanisms
  1.1346 +         to enable Web pages to request and connect with <abbr title="Hypertext Transfer Protocol">HTTP</abbr> services running on networked devices, discovered via either mechanism, through this <abbr title="Application Programming Interface">API</abbr>. When a <a href="#dfn-user-agent" class="internalDFN">user agent</a> implements either of these service discovery mechanisms, then it <em class="rfc2119" title="must">must</em> conform to the corresponding algorithms provided in this section of the specification.
  1.1347        </p>
  1.1348        <p>
  1.1349           This section presents how the results of these two service discovery
  1.1350 @@ -1734,7 +1162,7 @@
  1.1351        <p>
  1.1352           It is expected that user agents will perform these service discovery mechansisms asynchronously and periodically update the <a>list of networked devices</a> as required. The timing of any
  1.1353           service discovery mechanisms is an implementation detail left to the discretion of the implementer (e.g. once on user agent start-up, every X seconds during user agent execution or on
  1.1354 -         invocation of this <acronym title="Application Programming Interface">API</acronym> from a Web page).
  1.1355 +         invocation of this <abbr title="Application Programming Interface">API</abbr> from a Web page).
  1.1356        </p>
  1.1357  
  1.1358        <p>
  1.1359 @@ -1743,19 +1171,19 @@
  1.1360           services changes. Each record contained within this table contains the attributes: <code>id</code>, <code>name</code>, <code>type</code>, <code>url</code> and <code>config</code>.
  1.1361        </p>
  1.1362  
  1.1363 -            <section id="zeroconf--mdns---dns-sd" about="#zeroconf--mdns---dns-sd" typeof="bibo:Chapter">
  1.1364 -         <h3><span class="secno">7.1 </span>Zeroconf (<acronym title="Multicast DNS"><acronym title="Multicast DNS">mDNS</acronym></acronym> + <acronym title="Domain Name System"><acronym title="Domain Name System">DNS</acronym></acronym>-<acronym title="Service Discovery"><acronym title="Service Discovery">SD</acronym></acronym>)</h3>
  1.1365 +            <section id="zeroconf-mdns-dns-sd">
  1.1366 +         <h3><span class="secno">7.1 </span>Zeroconf (<abbr title="Multicast DNS">mDNS</abbr> + <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr>)</h3>
  1.1367  
  1.1368           <p>
  1.1369 -            For each <acronym title="Domain Name System">DNS</acronym> response received from a user-agent-initiated Multicast <acronym title="Domain Name System">DNS</acronym> Browse for <acronym title="DNS Pointer Record"><acronym title="DNS Pointer Record">PTR</acronym></acronym> records with the name <code>_services._dns-sd._udp</code> on the resolved recommended automatic browsing
  1.1370 -   domain [<cite><a class="bibref" rel="biblioentry" 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 following steps:
  1.1371 +            For each <abbr title="Domain Name System">DNS</abbr> response received from a user-agent-initiated Multicast <abbr title="Domain Name System">DNS</abbr> Browse for <abbr title="DNS Pointer Record">PTR</abbr> records with the name <code>_services._dns-sd._udp</code> on the resolved recommended automatic browsing
  1.1372 +   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 following steps:
  1.1373           </p>
  1.1374  
  1.1375           <ol class="rule">
  1.1376  
  1.1377 -            <li>Let <var>service <acronym title="Multicast DNS">mDNS</acronym> responses</var> be an array of <acronym title="DNS Pointer Record">PTR</acronym> records received by issuing a Multicast <acronym title="Domain Name System">DNS</acronym> Browse for <acronym title="DNS Pointer Record">PTR</acronym> records with the name of the current discovered service type.</li>
  1.1378 +            <li>Let <var>service <abbr title="Multicast DNS">mDNS</abbr> responses</var> be an array of <abbr title="DNS Pointer Record">PTR</abbr> records received by issuing a Multicast <abbr title="Domain Name System">DNS</abbr> Browse for <abbr title="DNS Pointer Record">PTR</abbr> records with the name of the current discovered service type.</li>
  1.1379  
  1.1380 -            <li>For each Object <var>service <acronym title="Multicast DNS">mDNS</acronym> response</var> in <var>service <acronym title="Multicast DNS">mDNS</acronym> responses</var>, run the following steps:
  1.1381 +            <li>For each Object <var>service <abbr title="Multicast DNS">mDNS</abbr> response</var> in <var>service <abbr title="Multicast DNS">mDNS</abbr> responses</var>, run the following steps:
  1.1382                 <ol>
  1.1383  
  1.1384                    <li>
  1.1385 @@ -1763,23 +1191,23 @@
  1.1386                    </li>
  1.1387  
  1.1388                    <li>
  1.1389 -                     Set <var>network service record</var>'s <code>id</code> property to the value of the full <acronym title="DNS Pointer Record">PTR</acronym> Service Instance Name [<cite><a class="bibref" rel="biblioentry" href="#bib-MDNS">MDNS</a></cite>].
  1.1390 +                     Set <var>network service record</var>'s <code>id</code> property to the value of the full <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.1391                    </li>
  1.1392  
  1.1393                    <li>
  1.1394 -                     Set <var>network service record</var>'s <code>name</code> property to the value of the <acronym title="DNS Pointer Record">PTR</acronym> Service Instance Name's <var>Instance</var> component [<cite><a class="bibref" rel="biblioentry" href="#bib-MDNS">MDNS</a></cite>].
  1.1395 +                     Set <var>network service record</var>'s <code>name</code> property to the value of the <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name's <var>Instance</var> component [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.1396                    </li>
  1.1397  
  1.1398                    <li>
  1.1399 -                     Set <var>network service record</var>'s <code>type</code> property to the concatenation of the string <code>zeroconf:</code> followed by the value of the <acronym title="DNS Pointer Record">PTR</acronym> Service Instance Name's <var>Service</var> component [<cite><a class="bibref" rel="biblioentry" href="#bib-MDNS">MDNS</a></cite>].
  1.1400 +                     Set <var>network service record</var>'s <code>type</code> property to the concatenation of the string <code>zeroconf:</code> followed by the value of the <abbr title="DNS Pointer Record">PTR</abbr> Service Instance Name's <var>Service</var> component [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.1401                    </li>
  1.1402  
  1.1403                    <li>
  1.1404 -                     Set <var>network service record</var>'s <code>url</code> property to the resolvable Service <acronym title="Uniform Resource Locator">URL</acronym> obtained from performing an <acronym title="Domain Name System">DNS</acronym>-<acronym title="Service Discovery">SD</acronym> Lookup [<cite><a class="bibref" rel="biblioentry" href="#bib-DNS-SD">DNS-SD</a></cite>] of the current service from the <acronym title="DNS Pointer Record">PTR</acronym> record provided [<cite><a class="bibref" rel="biblioentry" href="#bib-MDNS">MDNS</a></cite>].
  1.1405 +                     Set <var>network service record</var>'s <code>url</code> property to the resolvable Service <abbr title="Uniform Resource Locator">URL</abbr> obtained from performing an <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> Lookup [<cite><a class="bibref" href="#bib-DNS-SD">DNS-SD</a></cite>] of the current service from the <abbr title="DNS Pointer Record">PTR</abbr> record provided [<cite><a class="bibref" href="#bib-MDNS">MDNS</a></cite>].
  1.1406                    </li>
  1.1407  
  1.1408                    <li>
  1.1409 -                     Set <var>network service record</var>'s <code>config</code> property to the string value of the contents of the first <acronym title="Domain Name System">DNS</acronym>-<acronym title="Service Discovery">SD</acronym> TXT record associated with the <var>service <acronym title="Multicast DNS">mDNS</acronym> response</var> as defined in [<cite><a class="bibref" rel="biblioentry" href="#bib-DNS-SD">DNS-SD</a></cite>].
  1.1410 +                     Set <var>network service record</var>'s <code>config</code> property to the string value of the contents of the first <abbr title="Domain Name System">DNS</abbr>-<abbr title="Service Discovery">SD</abbr> TXT record associated with the <var>service <abbr title="Multicast DNS">mDNS</abbr> response</var> as defined in [<cite><a class="bibref" href="#bib-DNS-SD">DNS-SD</a></cite>].
  1.1411                    </li>
  1.1412  
  1.1413                    <li>
  1.1414 @@ -1828,17 +1256,17 @@
  1.1415  
  1.1416        </section>
  1.1417  
  1.1418 -      <section id="universal-plug-and-play--upnp" about="#universal-plug-and-play--upnp" typeof="bibo:Chapter">
  1.1419 -         <h3><span class="secno">7.2 </span>Universal Plug-and-Play (<acronym title="Universal Plug-and-Play"><acronym title="Universal Plug-and-Play">UPnP</acronym></acronym>)</h3>
  1.1420 +      <section id="universal-plug-and-play-upnp">
  1.1421 +         <h3><span class="secno">7.2 </span>Universal Plug-and-Play (<abbr title="Universal Plug-and-Play">UPnP</abbr>)</h3>
  1.1422  
  1.1423           <p>
  1.1424 -            For each <acronym title="Simple Service Discovery Protocol">SSDP</acronym> Presence Announcement [<cite><a class="bibref" rel="biblioentry" href="#bib-UPNP">UPNP</a></cite>] - a <acronym title="Hypertext Transfer Protocol">HTTP</acronym> NOTIFY request - received from a user-agent-initiated <acronym title="Simple Service Discovery Protocol">SSDP</acronym> Discovery Request [<cite><a class="bibref" rel="biblioentry" href="#bib-UPNP">UPNP</a></cite>], the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> run the following steps:
  1.1425 +            For each <acronym title="Simple Service Discovery Protocol">SSDP</acronym> Presence Announcement [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>] - a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request - received from a user-agent-initiated <acronym title="Simple Service Discovery Protocol">SSDP</acronym> Discovery Request [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>], the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> run the following steps:
  1.1426           </p>
  1.1427  
  1.1428           <ol class="rule">
  1.1429              <li>
  1.1430 -               Let <var>ssdp device</var> be an Object with a property for each <acronym title="Hypertext Transfer Protocol">HTTP</acronym> header received in the received <acronym title="Simple Service Discovery Protocol">SSDP</acronym> Presence Announcement, with each key being the name of a <acronym title="Hypertext Transfer Protocol">HTTP</acronym> header and its
  1.1431 -               value being that <acronym title="Hypertext Transfer Protocol">HTTP</acronym> header's accompanying value.
  1.1432 +               Let <var>ssdp device</var> be an Object with a property for each <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header received in the received <acronym title="Simple Service Discovery Protocol">SSDP</acronym> Presence Announcement, with each key being the name of a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header and its
  1.1433 +               value being that <abbr title="Hypertext Transfer Protocol">HTTP</abbr> header's accompanying value.
  1.1434              </li>
  1.1435  
  1.1436              <li>
  1.1437 @@ -1850,8 +1278,8 @@
  1.1438              </li>
  1.1439  
  1.1440              <li>
  1.1441 -               Let <var>root device descriptor file</var> contain the contents of the file located at the <acronym title="Uniform Resource Locator">URL</acronym> provided in the first occurrence of <var>Location</var> obtained according to the rules
  1.1442 -               defined in the section 'Retrieving a description using <acronym title="Hypertext Transfer Protocol">HTTP</acronym>' [<cite><a class="bibref" rel="biblioentry" href="#bib-UPNP">UPNP</a></cite>].
  1.1443 +               Let <var>root device descriptor file</var> contain the contents of the file located at the <abbr title="Uniform Resource Locator">URL</abbr> provided in the first occurrence of <var>Location</var> obtained according to the rules
  1.1444 +               defined in the section 'Retrieving a description using <abbr title="Hypertext Transfer Protocol">HTTP</abbr>' [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.1445              </li>
  1.1446  
  1.1447              <li>
  1.1448 @@ -1860,7 +1288,7 @@
  1.1449  
  1.1450              <li>
  1.1451                 Let <var>advertised services</var> be a <a>list of all advertised services</a> obtained from the <var>root device descriptor file</var> containing all sub-nodes of the <code>serviceList</code> node as described in
  1.1452 -               the section 'Device Description' [<cite><a class="bibref" rel="biblioentry" href="#bib-UPNP">UPNP</a></cite>].
  1.1453 +               the section 'Device Description' [<cite><a class="bibref" href="#bib-UPNP-DEVICEARCH11">UPNP-DEVICEARCH11</a></cite>].
  1.1454              </li>
  1.1455  
  1.1456              <li>
  1.1457 @@ -1928,23 +1356,30 @@
  1.1458                       <a href="#networkservice"><code>NetworkService</code></a> object.
  1.1459                    </li>
  1.1460                    <li>
  1.1461 -                     If the <var>announcement type</var> equals <code>ssdp:alive</code> then Increment the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the <a href="#networkservices"><code>NetworkServices</code></a>
  1.1462 +                     If the <var>announcement type</var> equals <code>ssdp:alive</code> then increment the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the <a href="#networkservices"><code>NetworkServices</code></a>
  1.1463                       object by <code>1</code> and then <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
  1.1464 +                      to dispatch a newly created event with the name <code>serviceavailable</code> that uses the <code>Event</code> interface, which does not bubble, is not cancellable, and has no default action, at the current
  1.1465 +                      <a href="#networkservice"><code>NetworkServices</code></a> object. Otherwise, decrement the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the <a href="#networkservices"><code>NetworkServices</code></a>
  1.1466 +                     object by <code>1</code> and then  <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
  1.1467 +                       to dispatch a newly created event with the name <code>serviceunavailable</code> that uses the <code>Event</code> interface, which does not bubble, is not cancellable, and has no default action, at the current
  1.1468 +                       <a href="#networkservice"><code>NetworkServices</code></a> object.
  1.1469 +                  </li>
  1.1470 +                  <li>
  1.1471 +                     If the <var>announcement type</var> equals <code>ssdp:alive</code> then <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
  1.1472                        to dispatch a newly created event with the name <code>serviceonline</code> that uses the <code>Event</code> interface, which does not bubble, is not cancellable, and has no default action, at the current
  1.1473 -                      <a href="#networkservice"><code>NetworkService</code></a> object. Otherwise, decrement the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the <a href="#networkservices"><code>NetworkServices</code></a>
  1.1474 -                     object by <code>1</code> and then  <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
  1.1475 +                      <a href="#networkservice"><code>NetworkService</code></a> object. Otherwise, <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
  1.1476                         to dispatch a newly created event with the name <code>serviceoffline</code> that uses the <code>Event</code> interface, which does not bubble, is not cancellable, and has no default action, at the current
  1.1477 -                       <a href="#networkservice"><code>NetworkService</code></a> object..
  1.1478 +                       <a href="#networkservice"><code>NetworkService</code></a> object.
  1.1479                    </li>
  1.1480                 </ol>
  1.1481              </li>
  1.1482           </ol>
  1.1483  
  1.1484           <p>
  1.1485 -            A <dfn id="dfn-user-agent-generated-callback-url">user-agent generated callback url</dfn> is a Local-network accessible <acronym title="Uniform Resource Locator">URL</acronym> endpoint that a <a href="#dfn-user-agent" class="internalDFN">user agent</a> must generate and maintain for receiving <acronym title="Hypertext Transfer Protocol">HTTP</acronym> NOTIFY requests from <acronym title="Universal Plug-and-Play">UPnP</acronym> Event sources.
  1.1486 +            A <dfn id="dfn-user-agent-generated-callback-url">user-agent generated callback url</dfn> is a Local-network accessible <abbr title="Uniform Resource Locator">URL</abbr> endpoint that a <a href="#dfn-user-agent" class="internalDFN">user agent</a> must generate and maintain for receiving <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY requests from <abbr title="Universal Plug-and-Play">UPnP</abbr> Event sources.
  1.1487           </p>
  1.1488  
  1.1489 -         <p>When the <a href="#dfn-user-agent" class="internalDFN">user agent</a> is to <dfn id="dfn-setup-a-upnp-events-subscription">setup a <acronym title="Universal Plug-and-Play">UPnP</acronym> Events Subscription</dfn>, it is to run the following steps with the current <var>network service record</var> object:</p>
  1.1490 +         <p>When the <a href="#dfn-user-agent" class="internalDFN">user agent</a> is to <dfn id="dfn-setup-a-upnp-events-subscription">setup a <abbr title="Universal Plug-and-Play">UPnP</abbr> Events Subscription</dfn>, it is to run the following steps with the current <var>network service record</var> object:</p>
  1.1491  
  1.1492           <ol class="rule">
  1.1493              <li>
  1.1494 @@ -1952,17 +1387,17 @@
  1.1495              </li>
  1.1496  
  1.1497              <li>
  1.1498 -               Let <var>callback <acronym title="Uniform Resource Locator">URL</acronym></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.1499 +               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.1500              </li>
  1.1501  
  1.1502              <li>
  1.1503 -               Send a <acronym title="Hypertext Transfer Protocol">HTTP</acronym> SUBSCRIBE request with a <em>NT</em> header with a string value of <code>upnp:event</code>, a <em>TIMEOUT</em> header with an integer value ofƒ
  1.1504 +               Send a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> SUBSCRIBE request with a <em>NT</em> header with a string value of <code>upnp:event</code>, a <em>TIMEOUT</em> header with an integer value ofƒ
  1.1505                 <code>86400</code> and a <em>CALLBACK</em> header
  1.1506 -               with a string value of <var>callback <acronym title="Uniform Resource Locator">URL</acronym></var> towards the <var>network service record</var>'s <code>eventsUrl</code> property.
  1.1507 +               with a string value of <var>callback <abbr title="Uniform Resource Locator">URL</abbr></var> towards the <var>network service record</var>'s <code>eventsUrl</code> property.
  1.1508              </li>
  1.1509  
  1.1510              <li>
  1.1511 -               If a non-200 OK response is received from the <acronym title="Hypertext Transfer Protocol">HTTP</acronym> SUBSCRIBE request then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> abort these steps.
  1.1512 +               If a non-200 OK response is received from the <abbr title="Hypertext Transfer Protocol">HTTP</abbr> SUBSCRIBE request then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> abort these steps.
  1.1513              </li>
  1.1514  
  1.1515              <li>
  1.1516 @@ -1989,11 +1424,11 @@
  1.1517                             If <var>current date</var> is less than the <var>timeout date</var> then continue to the step labeled <em>refresh subscription</em> above.
  1.1518                          </li>
  1.1519                          <li>
  1.1520 -                           Send a <acronym title="Hypertext Transfer Protocol">HTTP</acronym> SUBSCRIBE request with a <em>SID</em> header with the string value of <var>callback ID</var> and a <em>TIMEOUT</em> header
  1.1521 +                           Send a <abbr title="Hypertext Transfer Protocol">HTTP</abbr> SUBSCRIBE request with a <em>SID</em> header with the string value of <var>callback ID</var> and a <em>TIMEOUT</em> header
  1.1522                             with an integer value of <code>86400</code> towards the <var>network service record</var>'s <code>eventsUrl</code> property.
  1.1523                          </li>
  1.1524                          <li>
  1.1525 -                           On receiving a valid 200 OK, update <var>callback ID</var> with the string value of the first included <em>SID</em> header, if it exists. All other <acronym title="Hypertext Transfer Protocol">HTTP</acronym>
  1.1526 +                           On receiving a valid 200 OK, update <var>callback ID</var> with the string value of the first included <em>SID</em> header, if it exists. All other <abbr title="Hypertext Transfer Protocol">HTTP</abbr>
  1.1527                             responses should cause the <a href="#dfn-user-agent" class="internalDFN">user agent</a> to continue from the step labeled <em>refresh subscription</em> above.
  1.1528                          </li>
  1.1529                       </ol>
  1.1530 @@ -2001,11 +1436,11 @@
  1.1531                    </li>
  1.1532  
  1.1533                    <li>
  1.1534 -                     <em>Listen</em>: For each <acronym title="Hypertext Transfer Protocol">HTTP</acronym> NOTIFY request received at the <var>callback <acronym title="Uniform Resource Locator">URL</acronym></var> the <a href="#dfn-user-agent" class="internalDFN">user agent</a> is to run the following steps:
  1.1535 +                     <em>Listen</em>: For each <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request received at the <var>callback <abbr title="Uniform Resource Locator">URL</abbr></var> the <a href="#dfn-user-agent" class="internalDFN">user agent</a> is to run the following steps:
  1.1536  
  1.1537                       <ol class="rule">
  1.1538                          <li>
  1.1539 -                           Let <var>content clone</var> be the result of obtaining the message body of the <acronym title="Hypertext Transfer Protocol">HTTP</acronym> NOTIFY 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> abort these steps.
  1.1540 +                           Let <var>content clone</var> be the result of obtaining the message body of the <abbr title="Hypertext Transfer Protocol">HTTP</abbr> NOTIFY request. If <var>content clone</var> is empty, then the <a href="#dfn-user-agent" class="internalDFN">user agent</a> <em class="rfc2119" title="must">must</em> abort these steps.
  1.1541                          </li>
  1.1542                          <li>
  1.1543                            Let <var>notification event</var> be a new simple event that uses the <code>Event</code> interface with the name <code>notify</code>,
  1.1544 @@ -2028,7 +1463,7 @@
  1.1545  
  1.1546           </section>
  1.1547  
  1.1548 -         <section id="network-topology-monitoring" about="#network-topology-monitoring" typeof="bibo:Chapter">
  1.1549 +         <section id="network-topology-monitoring">
  1.1550              <h3><span class="secno">7.3 </span>Network Topology Monitoring</h3>
  1.1551  
  1.1552                    <div>
  1.1553 @@ -2077,31 +1512,31 @@
  1.1554  
  1.1555                       <ol class="rule">
  1.1556                          <li>
  1.1557 -                           Re-issue an <acronym title="Multicast DNS">mDNS</acronym> search and <acronym title="Simple Service Discovery Protocol">SSDP</acronym> discovery search using all of the <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens initially provided to all active <a href="#networkservices"><code>NetworkServices</code></a> objects and handle all discovery responses according to the processing defined in <a href="#service-discovery" class="sec-ref">Section 7: Service Discovery</a>.
  1.1558 +                           Re-issue an <abbr title="Multicast DNS">mDNS</abbr> search and <acronym title="Simple Service Discovery Protocol">SSDP</acronym> discovery search using all of the <a href="#dfn-valid-service-type" class="internalDFN">valid service type</a> tokens initially provided to all active <a href="#networkservices"><code>NetworkServices</code></a> objects and handle all discovery responses according to the processing defined in <a href="#service-discovery">Section 7: Service Discovery</a>.
  1.1559                          </li>
  1.1560                       </ol>
  1.1561                    </div>
  1.1562           </section>
  1.1563 -      </div>
  1.1564 +      </section>
  1.1565  
  1.1566 -   <div id="garbage-collection" about="#garbage-collection" typeof="bibo:Chapter" class="section">
  1.1567 +   <section id="garbage-collection">
  1.1568        <!--OddPage--><h2><span class="secno">8. </span>Garbage collection</h2>
  1.1569  
  1.1570        <p>
  1.1571 -         A <a href="#networkservice" class="internalDFN"><code>NetworkService</code></a> object containing a <code>url</code> parameter currently in the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <acronym title="Uniform Resource Locator">URL</acronym> whitelist</a> <em class="rfc2119" title="must not">must not</em> be garbage collected.
  1.1572 +         A <a href="#networkservice" class="internalDFN"><code>NetworkService</code></a> object containing a <code>url</code> parameter currently 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> <em class="rfc2119" title="must not">must not</em> be garbage collected.
  1.1573        </p>
  1.1574  
  1.1575        <p>
  1.1576 -         Only when the user navigates away from the current browsing context can <a href="#networkservice" class="internalDFN"><code>NetworkService</code></a> objects be garbage-collected and records in the <a href="#dfn-entry-script-origin-s-url-whitelist" class="internalDFN">entry script origin's <acronym title="Uniform Resource Locator">URL</acronym> whitelist</a> be removed.
  1.1577 +         Only when the user navigates away from the current browsing context can <a href="#networkservice" class="internalDFN"><code>NetworkService</code></a> objects be garbage-collected and 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.
  1.1578        </p>
  1.1579  
  1.1580 -   </div>
  1.1581 +   </section>
  1.1582  
  1.1583  
  1.1584 -    <div id="use-cases-and-requirements" about="#use-cases-and-requirements" typeof="bibo:Chapter" class="section">
  1.1585 +    <section id="use-cases-and-requirements">
  1.1586        <!--OddPage--><h2><span class="secno">9. </span>Use Cases and Requirements</h2>
  1.1587  
  1.1588 -      <p>This section covers what the requirements are for this <acronym title="Application Programming Interface">API</acronym>, as well as illustrates some use cases.</p>
  1.1589 +      <p>This section covers what the requirements are for this <abbr title="Application Programming Interface">API</abbr>, as well as illustrates some use cases.</p>
  1.1590  
  1.1591        <ul class="rule">
  1.1592           <li>
  1.1593 @@ -2134,7 +1569,7 @@
  1.1594              <li>
  1.1595                 Example: A Web page advertises that it is capable of interacting with and controlling multiple types of Home Media Server. The user can select their Home Media Server type from a drop-down list or known Media Servers, at which point the
  1.1596                 Web page sends a request to the user agent to connect with the associated service type (and, optionally, the associated event type) of the Home Media Server. The communiciation protocols supported by Home Media Servers typically vary
  1.1597 -               between <acronym title="Universal Plug-and-Play">UPnP</acronym>, JSON-RPC, Protocol Buffers or other messaging formats depending on the Home Media Server requested. The Web page is able to communicate with the user-selected Home Media
  1.1598 +               between <abbr title="Universal Plug-and-Play">UPnP</abbr>, JSON-RPC, Protocol Buffers or other messaging formats depending on the Home Media Server requested. The Web page is able to communicate with the user-selected Home Media
  1.1599                 Server in the messaging format supported by that Device, which, in this example is a simple key/value pair text format.
  1.1600              </li>
  1.1601             </ul>
  1.1602 @@ -2162,22 +1597,78 @@
  1.1603           </li>
  1.1604  
  1.1605           <li>
  1.1606 -           User agents should provide an <acronym title="Application Programming Interface">API</acronym> exposed to script that exposes the features above. The user is notified by UI anytime interaction with Local-networked Services is requested, giving the user
  1.1607 +           User agents should provide an <abbr title="Application Programming Interface">API</abbr> exposed to script that exposes the features above. The user is notified by UI anytime interaction with Local-networked Services is requested, giving the user
  1.1608             full ability to cancel or abort the transaction. The user selects the Local-networked Services to be connected to the current Web page, and can cancel these at any time. No invocations to
  1.1609             these APIs occur silently without user intervention.
  1.1610           </li>
  1.1611        </ul>
  1.1612 -    </div>
  1.1613 +    </section>
  1.1614  
  1.1615 -          <div class="informative appendix section" id="examples" about="#examples" typeof="bibo:Chapter">
  1.1616 -             <!--OddPage--><h2><span class="secno">A. </span>Examples</h2><em>This section is non-normative.</em>
  1.1617 +          <section class="informative appendix" id="examples">
  1.1618 +             <!--OddPage--><h2><span class="secno">A. </span>Examples</h2><p><em>This section is non-normative.</em></p>
  1.1619  
  1.1620             <div class="example">
  1.1621              <p>This sample code exposes a button. When clicked, this button is disabled and the user is prompted to offer a network service. The user may also select multiple network services. When the user has authorized a network service to be connected to the web page then the web page issues a simple command to get a list of all the albums stored on the connected media player service.
  1.1622              </p><p>The button is re-enabled only when the connected network service disconnects for whatever reason (the service becomes unavailable on the network, the user disconnects from their current network or the user revokes access to the service from the current web page). At this point the user can re-click the button to select a new network service to connect to the web page and the above steps are repeated.</p>
  1.1623              <p>The provided service type identifier and service interaction used in this example is based on the well-defined service type and messaging format supported by the <a href="http://xbmc.org/about/">XBMC Media Server</a>. </p>
  1.1624              <hr>
  1.1625 -            <div><div id="highlighter_143333" class="syntaxhighlighter nogutter  js"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="js plain">&lt;input type=</code><code class="js string">"button"</code> <code class="js plain">value=</code><code class="js string">"Start"</code> <code class="js plain">onclick=</code><code class="js string">"start()"</code> <code class="js plain">id=</code><code class="js string">"startBtn"</code><code class="js plain">/&gt;</code></div><div class="line number2 index1 alt1"><code class="js plain">&lt;div id=</code><code class="js string">"debugconsole"</code><code class="js plain">&gt;&lt;/div&gt;</code></div><div class="line number3 index2 alt2">&nbsp;</div><div class="line number4 index3 alt1"><code class="js plain">&lt;script&gt;</code></div><div class="line number5 index4 alt2"><code class="js spaces">&nbsp;</code><code class="js keyword">var</code> <code class="js plain">startBtn = document.getElementById(</code><code class="js string">'startBtn'</code><code class="js plain">),</code></div><div class="line number6 index5 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug = document.getElementById(</code><code class="js string">'debugconsole'</code><code class="js plain">);</code></div><div class="line number7 index6 alt2">&nbsp;</div><div class="line number8 index7 alt1"><code class="js spaces">&nbsp;</code><code class="js keyword">function</code> <code class="js plain">start() {</code></div><div class="line number9 index8 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js keyword">if</code><code class="js plain">(navigator.getNetworkServices) {</code></div><div class="line number10 index9 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">navigator.getNetworkServices(</code><code class="js string">'zeroconf:_xbmc-jsonrpc._tcp'</code><code class="js plain">, gotXBMCService, error);</code></div><div class="line number11 index10 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">startBtn.disabled = </code><code class="js keyword">true</code><code class="js plain">;</code></div><div class="line number12 index11 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">} </code><code class="js keyword">else</code> <code class="js plain">{</code></div><div class="line number13 index12 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.innerHTML += </code><code class="js string">"&lt;br&gt;Service Discovery not supported!"</code><code class="js plain">;</code></div><div class="line number14 index13 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">}</code></div><div class="line number15 index14 alt2"><code class="js spaces">&nbsp;</code><code class="js plain">}</code></div><div class="line number16 index15 alt1">&nbsp;</div><div class="line number17 index16 alt2"><code class="js spaces">&nbsp;</code><code class="js keyword">function</code> <code class="js plain">gotXBMCService(services) {</code></div><div class="line number18 index17 alt1">&nbsp;</div><div class="line number19 index18 alt2"><code class="js comments">// Listen for service disconnect messages</code></div><div class="line number20 index19 alt1">&nbsp;</div><div class="line number21 index20 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">services[0].addEventListener(</code><code class="js string">'serviceoffline'</code><code class="js plain">, </code><code class="js keyword">function</code> <code class="js plain">( e ) {</code></div><div class="line number22 index21 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.innerHTML += </code><code class="js string">"&lt;br&gt;"</code> <code class="js plain">+ services[0].name + </code><code class="js string">" disconnected."</code><code class="js plain">;</code></div><div class="line number23 index22 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">startBtn.disabled = </code><code class="js keyword">false</code><code class="js plain">;</code></div><div class="line number24 index23 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">}, </code><code class="js keyword">false</code><code class="js plain">);</code></div><div class="line number25 index24 alt2">&nbsp;</div><div class="line number26 index25 alt1"><code class="js comments">// Send a service message to get albums list (and process the service response)</code></div><div class="line number27 index26 alt2">&nbsp;</div><div class="line number28 index27 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js keyword">var</code> <code class="js plain">svcXhr = </code><code class="js keyword">new</code> <code class="js plain">XMLHttpRequest();</code></div><div class="line number29 index28 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">svcXhr.open(</code><code class="js string">"POST"</code><code class="js plain">, services[0].url + </code><code class="js string">"/getAlbums"</code><code class="js plain">); </code><code class="js comments">// services[0].url and its subresources have been</code></div><div class="line number30 index29 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js comments">// whitelisted for cross-site XHR use in this</code></div><div class="line number31 index30 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js comments">// current browsing context.</code></div><div class="line number32 index31 alt1">&nbsp;</div><div class="line number33 index32 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">svcXhr.setRequestHeader(</code><code class="js string">'Content-Type'</code><code class="js plain">, </code><code class="js string">'application/json-rpc'</code><code class="js plain">);</code></div><div class="line number34 index33 alt1">&nbsp;</div><div class="line number35 index34 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">svcXhr.addEventListener(</code><code class="js string">'readystatechange'</code><code class="js plain">, </code><code class="js keyword">function</code> <code class="js plain">( response ) {</code></div><div class="line number36 index35 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js keyword">if</code><code class="js plain">( response.readyState != 4 || response.status != 200 )</code></div><div class="line number37 index36 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js keyword">return</code><code class="js plain">;</code></div><div class="line number38 index37 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.innerHTML += </code><code class="js string">"&lt;br&gt;"</code> <code class="js plain">+ services[0].name + </code><code class="js string">" response received: "</code><code class="js plain">;</code></div><div class="line number39 index38 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.textContent += JSON.parse(response.responseText);</code></div><div class="line number40 index39 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">}, </code><code class="js keyword">false</code><code class="js plain">);</code></div><div class="line number41 index40 alt2">&nbsp;</div><div class="line number42 index41 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js keyword">var</code> <code class="js plain">svcMsg = [</code></div><div class="line number43 index42 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">{ </code><code class="js string">"jsonrpc"</code><code class="js plain">: </code><code class="js string">"2.0"</code><code class="js plain">, </code><code class="js string">"method"</code><code class="js plain">: </code><code class="js string">"AudioLibrary.GetAlbums"</code><code class="js plain">, </code><code class="js string">"params"</code><code class="js plain">: { </code><code class="js string">"genreid"</code><code class="js plain">: -1,</code></div><div class="line number44 index43 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">"artistid"</code><code class="js plain">: -1, </code><code class="js string">"start"</code><code class="js plain">: -1, </code><code class="js string">"end"</code><code class="js plain">: -1 }, </code><code class="js string">"id"</code><code class="js plain">: </code><code class="js string">"1"</code> <code class="js plain">}</code></div><div class="line number45 index44 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">];</code></div><div class="line number46 index45 alt1">&nbsp;</div><div class="line number47 index46 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">svcXhr.send(JSON.stringify(svcMsg));</code></div><div class="line number48 index47 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.innerHTML += </code><code class="js string">"&lt;br&gt;"</code> <code class="js plain">+ services[0].name + </code><code class="js string">" request sent: "</code><code class="js plain">;</code></div><div class="line number49 index48 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.textContent += JSON.stringify(svcMsg);</code></div><div class="line number50 index49 alt1">&nbsp;</div><div class="line number51 index50 alt2"><code class="js spaces">&nbsp;</code><code class="js plain">}</code></div><div class="line number52 index51 alt1">&nbsp;</div><div class="line number53 index52 alt2"><code class="js spaces">&nbsp;</code><code class="js keyword">function</code> <code class="js plain">error( err ) {</code></div><div class="line number54 index53 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.innerHTML += </code><code class="js string">"&lt;br&gt;An error occurred obtaining a local network service."</code><code class="js plain">;</code></div><div class="line number55 index54 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;</code><code class="js plain">startBtn.disabled = </code><code class="js keyword">false</code><code class="js plain">;</code></div><div class="line number56 index55 alt1"><code class="js spaces">&nbsp;</code><code class="js plain">}</code></div><div class="line number57 index56 alt2"><code class="js plain">&lt;/script&gt;</code></div></div></td></tr></tbody></table></div></div>
  1.1626 +            <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.1627 +</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.1628 +
  1.1629 +</span><span class="tag">&lt;script&gt;</span><span class="pln">
  1.1630 + </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.1631 +     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.1632 +
  1.1633 + </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.1634 +   </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.1635 +      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.1636 +      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.1637 +   </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.1638 +      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.1639 +   </span><span class="pun">}</span><span class="pln">
  1.1640 + </span><span class="pun">}</span><span class="pln">
  1.1641 +
  1.1642 + </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.1643 +
  1.1644 +</span><span class="com">// Listen for service disconnect messages</span><span class="pln">
  1.1645 +
  1.1646 +   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.1647 +       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.1648 +       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.1649 +   </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.1650 +
  1.1651 +</span><span class="com">// Send a service message to get albums list (and process the service response)</span><span class="pln">
  1.1652 +
  1.1653 +   </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.1654 +   svcXhr</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">"POST"</span><span class="pun">,</span><span class="pln"> services</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">url </span><span class="pun">+</span><span class="pln"> </span><span class="str">"/getAlbums"</span><span class="pun">);</span><span class="pln"> </span><span class="com">// services[0].url and its subresources have been</span><span class="pln">
  1.1655 +                                                        </span><span class="com">// whitelisted for cross-site XHR use in this</span><span class="pln">
  1.1656 +                                                        </span><span class="com">// current browsing context.</span><span class="pln">
  1.1657 +
  1.1658 +   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.1659 +
  1.1660 +   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.1661 +     </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.1662 +        </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
  1.1663 +     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.1664 +     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.1665 +   </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.1666 +
  1.1667 +   </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.1668 +     </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.1669 +         </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.1670 +   </span><span class="pun">];</span><span class="pln">
  1.1671 +
  1.1672 +   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.1673 +   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.1674 +   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.1675 +
  1.1676 + </span><span class="pun">}</span><span class="pln">
  1.1677 +
  1.1678 + </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.1679 +   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.1680 +   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.1681 + </span><span class="pun">}</span><span class="pln">
  1.1682 +</span><span class="tag">&lt;/script&gt;</span></pre>
  1.1683             </div>
  1.1684  
  1.1685             <div class="example">
  1.1686 @@ -2189,12 +1680,113 @@
  1.1687               <br><br>Once the user has authorized the device, the web page sends a simple mute command according to the messaging format supported by the device.
  1.1688              </p>
  1.1689              <hr>
  1.1690 -            <div><div id="highlighter_960554" class="syntaxhighlighter nogutter  js"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container"><div class="line number1 index0 alt2"><code class="js plain">&lt;select name=</code><code class="js string">"make"</code> <code class="js plain">id=</code><code class="js string">"make"</code><code class="js plain">&gt;</code></div><div class="line number2 index1 alt1"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">&lt;option selected=</code><code class="js string">"selected"</code> <code class="js plain">disabled=</code><code class="js string">"disabled"</code><code class="js plain">&gt;Select make&lt;/option&gt;</code></div><div class="line number3 index2 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">&lt;option&gt;Sony&lt;/option&gt;</code></div><div class="line number4 index3 alt1"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">&lt;option&gt;Philips&lt;/option&gt;</code></div><div class="line number5 index4 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">&lt;option&gt;Alba&lt;/option&gt;</code></div><div class="line number6 index5 alt1"><code class="js plain">&lt;/select&gt;</code></div><div class="line number7 index6 alt2"><code class="js plain">&lt;select name=</code><code class="js string">"model"</code> <code class="js plain">id=</code><code class="js string">"model"</code><code class="js plain">&gt;&lt;/select&gt;</code></div><div class="line number8 index7 alt1"><code class="js plain">&lt;div id=</code><code class="js string">"debugconsole"</code><code class="js plain">&gt;&lt;/div&gt;</code></div><div class="line number9 index8 alt2">&nbsp;</div><div class="line number10 index9 alt1"><code class="js plain">&lt;script&gt;</code></div><div class="line number11 index10 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js keyword">var</code> <code class="js plain">debug = document.getElementById(</code><code class="js string">'debugconsole'</code><code class="js plain">);</code></div><div class="line number12 index11 alt1">&nbsp;</div><div class="line number13 index12 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js keyword">var</code> <code class="js plain">models = {</code></div><div class="line number14 index13 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">"Sony"</code><code class="js plain">: [</code></div><div class="line number15 index14 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">{</code><code class="js string">"name"</code><code class="js plain">: </code><code class="js string">"Bravia TV S1000"</code><code class="js plain">, </code><code class="js string">"type"</code><code class="js plain">: </code><code class="js string">"upnp"</code><code class="js plain">, </code><code class="js string">"service"</code><code class="js plain">: </code><code class="js string">"urn:schemas-upnp-org:service:RenderingControl:1"</code> <code class="js plain">},</code></div><div class="line number16 index15 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">{</code><code class="js string">"name"</code><code class="js plain">: </code><code class="js string">"Bravia TV S2000"</code><code class="js plain">, </code><code class="js string">"type"</code><code class="js plain">: </code><code class="js string">"zeroconf"</code><code class="js plain">, </code><code class="js string">"service"</code><code class="js plain">: </code><code class="js string">"_mediarenderer._http._tcp"</code> <code class="js plain">},</code></div><div class="line number17 index16 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">{</code><code class="js string">"name"</code><code class="js plain">: </code><code class="js string">"HiFi WD10"</code><code class="js plain">, </code><code class="js string">"type"</code><code class="js plain">: </code><code class="js string">"upnp"</code><code class="js plain">, </code><code class="js string">"service"</code><code class="js plain">: </code><code class="js string">"urn:schemas-upnp-org:service:RenderingControl:1"</code> <code class="js plain">}</code></div><div class="line number18 index17 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">],</code></div><div class="line number19 index18 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">"Philips"</code><code class="js plain">: [ </code><code class="js comments">/* ... */</code> <code class="js plain">],</code></div><div class="line number20 index19 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">"Alba"</code><code class="js plain">: [ </code><code class="js comments">/* ... */</code> <code class="js plain">]</code></div><div class="line number21 index20 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">};</code></div><div class="line number22 index21 alt1">&nbsp;</div><div class="line number23 index22 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js keyword">var</code> <code class="js plain">makeEl = document.getElementById(</code><code class="js string">"make"</code><code class="js plain">),</code></div><div class="line number24 index23 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">modelEl = document.getElementById(</code><code class="js string">"model"</code><code class="js plain">);</code></div><div class="line number25 index24 alt2">&nbsp;</div><div class="line number26 index25 alt1"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">makeEl.addEventListener(</code><code class="js string">'change'</code><code class="js plain">, </code><code class="js keyword">function</code><code class="js plain">() {</code></div><div class="line number27 index26 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">modelEl.innerHTML = </code><code class="js string">""</code><code class="js plain">; </code><code class="js comments">// reset</code></div><div class="line number28 index27 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js keyword">var</code> <code class="js plain">defaultOption = document.createElement(</code><code class="js string">"option"</code><code class="js plain">);</code></div><div class="line number29 index28 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">defaultOption.textContent = </code><code class="js string">"Select model"</code><code class="js plain">;</code></div><div class="line number30 index29 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">defaultOption.setAttribute(</code><code class="js string">"disabled"</code><code class="js plain">, </code><code class="js string">"disabled"</code><code class="js plain">);</code></div><div class="line number31 index30 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">defaultOption.setAttribute(</code><code class="js string">"selected"</code><code class="js plain">, </code><code class="js string">"selected"</code><code class="js plain">);</code></div><div class="line number32 index31 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">modelEl.appendChild(defaultOption);</code></div><div class="line number33 index32 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js keyword">for</code><code class="js plain">(</code><code class="js keyword">var</code> <code class="js plain">i = 0, l = models[makeEl.value].length; i &lt; l; i++) {</code></div><div class="line number34 index33 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js keyword">var</code> <code class="js plain">option = document.createElement(</code><code class="js string">"option"</code><code class="js plain">);</code></div><div class="line number35 index34 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">option.textContent = models[makeEl.value][i][</code><code class="js string">"name"</code><code class="js plain">];</code></div><div class="line number36 index35 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">option.setAttribute(</code><code class="js string">"value"</code><code class="js plain">, models[makeEl.value][i][</code><code class="js string">"type"</code><code class="js plain">] + </code><code class="js string">":"</code> <code class="js plain">+ models[makeEl.value][i][</code><code class="js string">"service"</code><code class="js plain">]);</code></div><div class="line number37 index36 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">modelEl.appendChild(option);</code></div><div class="line number38 index37 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">}</code></div><div class="line number39 index38 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">}, </code><code class="js keyword">false</code><code class="js plain">);</code></div><div class="line number40 index39 alt1">&nbsp;</div><div class="line number41 index40 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">modelEl.addEventListener(</code><code class="js string">'change'</code><code class="js plain">, </code><code class="js keyword">function</code><code class="js plain">() {</code></div><div class="line number42 index41 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js keyword">if</code><code class="js plain">(navigator.getNetworkServices &amp;&amp;</code></div><div class="line number43 index42 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">modelEl.value == </code><code class="js string">"upnp:urn:schemas-upnp-org:service:RenderingControl:1"</code><code class="js plain">) {</code></div><div class="line number44 index43 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">navigator.getNetworkServices(modelEl.value, successCallback, errorCallback);</code></div><div class="line number45 index44 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">} </code><code class="js keyword">else</code> <code class="js keyword">if</code> <code class="js plain">(modelEl.value == </code><code class="js string">"zeroconf:_mediarenderer._http._tcp"</code><code class="js plain">) {</code></div><div class="line number46 index45 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.innerHTML += </code><code class="js string">"&lt;br&gt;Service type is not implemented by this application."</code><code class="js plain">;</code></div><div class="line number47 index46 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">} </code><code class="js keyword">else</code> <code class="js plain">{</code></div><div class="line number48 index47 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.innerHTML += </code><code class="js string">"&lt;br&gt;Service Discovery is not supported!"</code><code class="js plain">;</code></div><div class="line number49 index48 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">}</code></div><div class="line number50 index49 alt1"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">}, </code><code class="js keyword">false</code><code class="js plain">);</code></div><div class="line number51 index50 alt2"><code class="js plain">&lt;/script&gt;</code></div><div class="line number52 index51 alt1">&nbsp;</div><div class="line number53 index52 alt2"><code class="js plain">&lt;script&gt;</code></div><div class="line number54 index53 alt1"><code class="js spaces">&nbsp;&nbsp;</code><code class="js keyword">function</code> <code class="js plain">successCallback( services ) {</code></div><div class="line number55 index54 alt2">&nbsp;</div><div class="line number56 index55 alt1"><code class="js spaces">&nbsp;&nbsp;</code><code class="js comments">// Listen for service push notification messages</code></div><div class="line number57 index56 alt2">&nbsp;</div><div class="line number58 index57 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">services[0].addEventListener(</code><code class="js string">'notify'</code><code class="js plain">, </code><code class="js keyword">function</code> <code class="js plain">( msg ) {</code></div><div class="line number59 index58 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.innerHTML += </code><code class="js string">"&lt;br&gt;"</code> <code class="js plain">+ services[0].name + </code><code class="js string">" event received: "</code><code class="js plain">;</code></div><div class="line number60 index59 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.textContent += msg.data;</code></div><div class="line number61 index60 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">}, </code><code class="js keyword">false</code><code class="js plain">);</code></div><div class="line number62 index61 alt1">&nbsp;</div><div class="line number63 index62 alt2"><code class="js spaces">&nbsp;</code><code class="js comments">// Send a control signal to mute the service audio</code></div><div class="line number64 index63 alt1">&nbsp;</div><div class="line number65 index64 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js keyword">var</code> <code class="js plain">svcXhr = </code><code class="js keyword">new</code> <code class="js plain">XMLHttpRequest();</code></div><div class="line number66 index65 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">svcXhr.open(</code><code class="js string">"POST"</code><code class="js plain">, services[0].url); </code><code class="js comments">// services[0].url and its</code></div><div class="line number67 index66 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js comments">// subresources have been whitelisted for</code></div><div class="line number68 index67 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js comments">// cross-site XHR use in this current</code></div><div class="line number69 index68 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js comments">// browsing context.</code></div><div class="line number70 index69 alt1">&nbsp;</div><div class="line number71 index70 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">svcXhr.setRequestHeader(</code><code class="js string">'SOAPAction'</code><code class="js plain">, </code><code class="js string">'urn:schemas-upnp-org:service:RenderingControl:1#SetMute'</code><code class="js plain">);</code></div><div class="line number72 index71 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">svcXhr.setRequestHeader(</code><code class="js string">'Content-Type'</code><code class="js plain">, </code><code class="js string">'text/xml; charset="utf-8";'</code><code class="js plain">);</code></div><div class="line number73 index72 alt2">&nbsp;</div><div class="line number74 index73 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">svcXhr.onreadystatechange = </code><code class="js keyword">function</code> <code class="js plain">( response ) {</code></div><div class="line number75 index74 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js keyword">if</code><code class="js plain">( response.readyState != 4 || response.status != 200 )</code></div><div class="line number76 index75 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js keyword">return</code><code class="js plain">;</code></div><div class="line number77 index76 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.innerHTML += </code><code class="js string">"&lt;br&gt;"</code> <code class="js plain">+ services[0].name + </code><code class="js string">" response received: "</code><code class="js plain">;</code></div><div class="line number78 index77 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.textContent += response.responseXML;</code></div><div class="line number79 index78 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">}</code></div><div class="line number80 index79 alt1">&nbsp;</div><div class="line number81 index80 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js comments">// Service messaging to mute the provided service</code></div><div class="line number82 index81 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js keyword">var</code> <code class="js plain">svcMsg = </code><code class="js string">'&lt;?xml version="1.0" encoding="utf-8"?&gt;'</code> <code class="js plain">+</code></div><div class="line number83 index82 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">'&lt;s:Envelope s:encodingStyle="<a href="http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.org/soap/encoding/</a>" '</code> <code class="js plain">+</code></div><div class="line number84 index83 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">'xmlns:s="<a href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</a>"&gt;'</code> <code class="js plain">+</code></div><div class="line number85 index84 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">'&lt;s:Body&gt;'</code> <code class="js plain">+</code></div><div class="line number86 index85 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">'&lt;u:SetMute xmlns:u="urn:schemas-upnp-org:service:RenderingControl:1"&gt;'</code> <code class="js plain">+</code></div><div class="line number87 index86 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">'&lt;InstanceID&gt;0&lt;/InstanceID&gt;'</code> <code class="js plain">+</code></div><div class="line number88 index87 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">'&lt;Channel&gt;Master&lt;/Channel&gt;'</code> <code class="js plain">+</code></div><div class="line number89 index88 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">'&lt;DesiredMute&gt;true&lt;/DesiredMute&gt;'</code> <code class="js plain">+</code></div><div class="line number90 index89 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">'&lt;/u:SetMute&gt;'</code> <code class="js plain">+</code></div><div class="line number91 index90 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">'&lt;/s:Body&gt;'</code> <code class="js plain">+</code></div><div class="line number92 index91 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js string">'&lt;/s:Envelope&gt;'</code><code class="js plain">;</code></div><div class="line number93 index92 alt2">&nbsp;</div><div class="line number94 index93 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">svcXhr.send(svcMsg);</code></div><div class="line number95 index94 alt2"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.innerHTML += </code><code class="js string">"&lt;br&gt;"</code> <code class="js plain">+ services[0].name + </code><code class="js string">" request sent: "</code><code class="js plain">;</code></div><div class="line number96 index95 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.textContent += svcMsg;</code></div><div class="line number97 index96 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">}</code></div><div class="line number98 index97 alt1">&nbsp;</div><div class="line number99 index98 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js keyword">function</code> <code class="js plain">errorCallback( error ) {</code></div><div class="line number100 index99 alt1"><code class="js spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="js plain">debug.innerHTML += </code><code class="js string">"&lt;br&gt;An error occurred: "</code> <code class="js plain">+ error.code;</code></div><div class="line number101 index100 alt2"><code class="js spaces">&nbsp;&nbsp;</code><code class="js plain">}</code></div><div class="line number102 index101 alt1"><code class="js plain">&lt;/script&gt;</code></div></div></td></tr></tbody></table></div></div>
  1.1691 +            <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.1692 +  </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.1693 +  </span><span class="tag">&lt;option&gt;</span><span class="pln">Sony</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.1694 +  </span><span class="tag">&lt;option&gt;</span><span class="pln">Philips</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.1695 +  </span><span class="tag">&lt;option&gt;</span><span class="pln">Alba</span><span class="tag">&lt;/option&gt;</span><span class="pln">
  1.1696 +</span><span class="tag">&lt;/select&gt;</span><span class="pln">
  1.1697 +</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.1698 +</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.1699 +
  1.1700 +</span><span class="tag">&lt;script&gt;</span><span class="pln">
  1.1701 +  </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.1702 +
  1.1703 +  </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.1704 +    </span><span class="str">"Sony"</span><span class="pun">:</span><span class="pln"> </span><span class="pun">[</span><span class="pln">
  1.1705 +      </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.1706 +      </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.1707 +      </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.1708 +    </span><span class="pun">],</span><span class="pln">
  1.1709 +    </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.1710 +    </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.1711 +  </span><span class="pun">};</span><span class="pln">
  1.1712 +
  1.1713 +  </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.1714 +      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.1715 +
  1.1716 +  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.1717 +    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.1718 +    </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.1719 +    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.1720 +    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.1721 +    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.1722 +    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.1723 +    </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.1724 +      </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.1725 +      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.1726 +      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.1727 +      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.1728 +    </span><span class="pun">}</span><span class="pln">
  1.1729 +  </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.1730 +
  1.1731 +  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.1732 +    </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.1733 +         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.1734 +      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.1735 +    </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.1736 +      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.1737 +    </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.1738 +      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.1739 +    </span><span class="pun">}</span><span class="pln">
  1.1740 +  </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.1741 +</span><span class="tag">&lt;/script&gt;</span><span class="pln">
  1.1742 +
  1.1743 +</span><span class="tag">&lt;script&gt;</span><span class="pln">
  1.1744 +  </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.1745 +
  1.1746 +  </span><span class="com">// Listen for service push notification messages</span><span class="pln">
  1.1747 +
  1.1748 +    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.1749 +         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.1750 +         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.1751 +    </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
  1.1752 +
  1.1753 + </span><span class="com">// Send a control signal to mute the service audio</span><span class="pln">
  1.1754 +
  1.1755 +    </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.1756 +    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.1757 +                                          </span><span class="com">// subresources have been whitelisted for</span><span class="pln">
  1.1758 +                                          </span><span class="com">// cross-site XHR use in this current</span><span class="pln">
  1.1759 +                                          </span><span class="com">// browsing context.</span><span class="pln">
  1.1760 +
  1.1761 +    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.1762 +    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.1763 +
  1.1764 +    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.1765 +      </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.1766 +        </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
  1.1767 +      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.1768 +      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.1769 +    </span><span class="pun">}</span><span class="pln">
  1.1770 +
  1.1771 +    </span><span class="com">// Service messaging to mute the provided service</span><span class="pln">
  1.1772 +    </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.1773 +                 </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.1774 +                   </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.1775 +                   </span><span class="str">'&lt;s:Body&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.1776 +                     </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.1777 +                       </span><span class="str">'&lt;InstanceID&gt;0&lt;/InstanceID&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.1778 +                       </span><span class="str">'&lt;Channel&gt;Master&lt;/Channel&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.1779 +                       </span><span class="str">'&lt;DesiredMute&gt;true&lt;/DesiredMute&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.1780 +                     </span><span class="str">'&lt;/u:SetMute&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.1781 +                   </span><span class="str">'&lt;/s:Body&gt;'</span><span class="pln"> </span><span class="pun">+</span><span class="pln">
  1.1782 +                 </span><span class="str">'&lt;/s:Envelope&gt;'</span><span class="pun">;</span><span class="pln">
  1.1783 +
  1.1784 +    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.1785 +    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.1786 +    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.1787 +  </span><span class="pun">}</span><span class="pln">
  1.1788 +
  1.1789 +  </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.1790 +    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.1791 +  </span><span class="pun">}</span><span class="pln">
  1.1792 +</span><span class="tag">&lt;/script&gt;</span></pre>
  1.1793            </div>
  1.1794  
  1.1795 -       </div>
  1.1796 +       </section>
  1.1797  
  1.1798 -    <div id="acknowledgements" about="#acknowledgements" typeof="bibo:Chapter" class="section">
  1.1799 +    <section id="acknowledgements">
  1.1800        <!--OddPage--><h2><span class="secno">B. </span>Acknowledgements</h2>
  1.1801  
  1.1802        <p>Thanks are expressed by the editor to the following individuals for their feedback on this specification to date (in alphabetical order):
  1.1803 @@ -2203,11 +1795,15 @@
  1.1804  
  1.1805        <p>Thanks are also expressed by the editor to the following organizations and groups for their support in producing this specification to date (in alphabetical order):
  1.1806        <br><br>
  1.1807 -      CableLabs, Opera Software ASA, <acronym title="World Wide Web Consortium">W3C</acronym> Device APIs Working Group, <acronym title="World Wide Web Consortium">W3C</acronym> Web and TV Interest Group, ...</p>
  1.1808 -    </div>
  1.1809 +      CableLabs, Opera Software ASA, <abbr title="World Wide Web Consortium">W3C</abbr> Device APIs Working Group, <abbr title="World Wide Web Consortium">W3C</abbr> Web and TV Interest Group, ...</p>
  1.1810 +    </section>
  1.1811  
  1.1812  
  1.1813 -
  1.1814 -
  1.1815 -
  1.1816 -<div id="references" class="appendix section" about="#references" typeof="bibo:Chapter"><!--OddPage--><h2><span class="secno">C. </span>References</h2><section id="normative-references" about="#normative-references" typeof="bibo:Chapter"><h3><span class="secno">C.1 </span>Normative references</h3><dl class="bibliography" about=""><dt id="bib-DNS-SD">[DNS-SD]</dt><dd rel="dc:requires">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></dd><dt id="bib-DOM-CORE">[DOM-CORE]</dt><dd rel="dc:requires">Anne van Kesteren; et al. <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html/"><cite>Web DOM Core</cite></a>. W3C Working Draft. (Work in progress.) 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> </dd><dt id="bib-HTML5">[HTML5]</dt><dd rel="dc:requires">Ian Hickson; David Hyatt. <a href="http://www.w3.org/TR/2010/WD-html5-20100304/"><cite>HTML 5.</cite></a> 4 March 2010. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2010/WD-html5-20100304/">http://www.w3.org/TR/2010/WD-html5-20100304/</a> </dd><dt id="bib-MDNS">[MDNS]</dt><dd rel="dc:requires">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></dd><dt id="bib-RFC2119">[RFC2119]</dt><dd rel="dc:requires">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> </dd><dt id="bib-UPNP">[UPNP]</dt><dd rel="dc:requires">UPnP Forum. <a href="http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf"><cite>UPnP Device Architecture. Version 1.1.</cite></a>. 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></dd><dt id="bib-WEBIDL">[WEBIDL]</dt><dd rel="dc:requires">Cameron McCormack. <a href="http://www.w3.org/TR/2008/WD-WebIDL-20081219"><cite>Web IDL.</cite></a> 19 December 2008. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2008/WD-WebIDL-20081219">http://www.w3.org/TR/2008/WD-WebIDL-20081219</a> </dd></dl></section></div></body></html>
  1.1817 \ No newline at end of file
  1.1818 +<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.1819 +</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.1820 +</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.1821 +</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.1822 +</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.1823 +</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.1824 +</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.1825 +</dd></dl></section><section id="informative-references"><h3><span class="secno">C.2 </span>Informative references</h3><p>No informative references.</p></section></section></body></html>
  1.1826 \ No newline at end of file
     2.1 --- a/discovery-api/Overview.src.html	Sat Aug 25 00:52:13 2012 +0300
     2.2 +++ b/discovery-api/Overview.src.html	Mon Aug 27 09:51:00 2012 +0300
     2.3 @@ -493,7 +493,7 @@
     2.4                 <dfn id="dom-navigatornetworkserviceerror-permission_denied" title="dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></dfn> (numeric value 1)
     2.5              </dt>
     2.6              <dd>
     2.7 -               The user denied the page permission to access any services.
     2.8 +               The user or user agent denied the page permission to access any services.
     2.9              </dd>
    2.10              <dt>
    2.11                 <dfn id="dom-navigatornetworkserviceerror-unknown_type_prefix" title="dom-navigatornetworkserviceerror-unknown_type_prefix"><code>UNKNOWN_TYPE_PREFIX_ERR</code></dfn> (numeric value 2)
    2.12 @@ -795,7 +795,7 @@
    2.13        </dl>
    2.14  
    2.15            <p>
    2.16 -            The <dfn id="dom-networkservice-id"><code>id</code></dfn> attribute is a unique identifier for the service. Two services provided at different times or on different objects MUST have the same <a href="#dom-networkservice-id"><code>id</code></a> value.
    2.17 +            The <dfn id="dom-networkservice-id"><code>id</code></dfn> attribute is a unique identifier for the service. The same service provided at different times or on different objects MUST have the same <a href="#dom-networkservice-id"><code>id</code></a> value.
    2.18           </p>
    2.19  
    2.20           <p>
    2.21 @@ -836,7 +836,7 @@
    2.22        </dl>
    2.23  
    2.24        <p>
    2.25 -        The <dfn id="dom-networkservice-config"><code>online</code></dfn> attribute indicates whether the service is reporting itself as being
    2.26 +        The <dfn id="dom-networkservice-online"><code>online</code></dfn> attribute indicates whether the service is reporting itself as being
    2.27          either <var>online</var>, and therefore accessible on the local network, in which case this attribute will return <code>true</code> or, <var>offline</var>, and therefore not accessible on the local network, either temporarily or permanently, in which case this attribute will return <code>false</code>. This attribute MUST default to <code>true</code>.
    2.28        </p>
    2.29  
    2.30 @@ -884,7 +884,7 @@
    2.31            </tr>
    2.32            <tr>
    2.33              <td>
    2.34 -              <dfn id="dom-networkservice-offserviceoffline" title="dom-NetworkService-onserviceoffline">
    2.35 +              <dfn id="dom-networkservice-onserviceoffline" title="dom-NetworkService-onserviceoffline">
    2.36                  <code>onserviceoffline</code>
    2.37                </dfn>
    2.38              </td>
    2.39 @@ -1111,13 +1111,20 @@
    2.40                       <a href="#networkservice"><code>NetworkService</code></a> object.
    2.41                    </li>
    2.42                    <li>
    2.43 -                     If the <var>announcement type</var> equals <code>ssdp:alive</code> then Increment the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the <a href="#networkservices"><code>NetworkServices</code></a>
    2.44 +                     If the <var>announcement type</var> equals <code>ssdp:alive</code> then increment the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the <a href="#networkservices"><code>NetworkServices</code></a>
    2.45                       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>
    2.46 +                      to dispatch a newly created event with the name <code>serviceavailable</code> that uses the <code>Event</code> interface, which does not bubble, is not cancellable, and has no default action, at the current
    2.47 +                      <a href="#networkservice"><code>NetworkServices</code></a> object. Otherwise, decrement the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the <a href="#networkservices"><code>NetworkServices</code></a>
    2.48 +                     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>
    2.49 +                       to dispatch a newly created event with the name <code>serviceunavailable</code> that uses the <code>Event</code> interface, which does not bubble, is not cancellable, and has no default action, at the current
    2.50 +                       <a href="#networkservice"><code>NetworkServices</code></a> object.
    2.51 +                  </li>
    2.52 +                  <li>
    2.53 +                     If the <var>announcement type</var> equals <code>ssdp:alive</code> then <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
    2.54                        to dispatch a newly created event with the name <code>serviceonline</code> that uses the <code>Event</code> interface, which does not bubble, is not cancellable, and has no default action, at the current
    2.55 -                      <a href="#networkservice"><code>NetworkService</code></a> object. Otherwise, decrement the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the <a href="#networkservices"><code>NetworkServices</code></a>
    2.56 -                     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>
    2.57 +                      <a href="#networkservice"><code>NetworkService</code></a> object. Otherwise, <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task" class="externalDFN">queue a task</a>
    2.58                         to dispatch a newly created event with the name <code>serviceoffline</code> that uses the <code>Event</code> interface, which does not bubble, is not cancellable, and has no default action, at the current
    2.59 -                       <a href="#networkservice"><code>NetworkService</code></a> object..
    2.60 +                       <a href="#networkservice"><code>NetworkService</code></a> object.
    2.61                    </li>
    2.62                 </ol>
    2.63              </li>