discovery-api/Overview.src.html
changeset 250 8b912f2bb9c7
parent 243 220f3226b2a1
child 254 f29ec967fb3b
     1.1 --- a/discovery-api/Overview.src.html	Tue Oct 02 17:01:27 2012 -0400
     1.2 +++ b/discovery-api/Overview.src.html	Wed Oct 03 02:40:46 2012 +0200
     1.3 @@ -132,9 +132,9 @@
     1.4          well-known discovery service type that it wishes to interact with.
     1.5        </p>
     1.6        <p>
     1.7 -        The user agent, having captured all advertised services on the network from the Service Discovery mechanisms
     1.8 -        included in this recommendation, attempts to match the requested service type to a discovered service according
     1.9 -        to the processing described herein.
    1.10 +        The user agent, having captured all advertised services on the network from the <a>service discovery
    1.11 +        mechanisms</a> included in this recommendation, attempts to match the requested service type to a discovered
    1.12 +        service according to the processing described herein.
    1.13        </p>
    1.14        <p>
    1.15          If a service connectivity request is successful then the Web page is provided with the necessary information to
    1.16 @@ -213,25 +213,24 @@
    1.17          are to be interpreted as requirements on user agents.
    1.18        </p>
    1.19        <p>
    1.20 -        Conformance requirements phrased as algorithms or specific steps MAY be implemented in any
    1.21 -        manner, so long as the end result is equivalent. (In particular, the algorithms defined in this specification
    1.22 -        are intended to be easy to follow, and not intended to be performant.)
    1.23 +        Conformance requirements phrased as algorithms or specific steps MAY be implemented in any manner, so long as
    1.24 +        the end result is equivalent. (In particular, the algorithms defined in this specification are intended to be
    1.25 +        easy to follow, and not intended to be performant.)
    1.26        </p>
    1.27        <p>
    1.28          The only conformance class defined by this specification is a <dfn>user agent</dfn>.
    1.29        </p>
    1.30        <p>
    1.31 -        User agents MAY impose implementation-specific limits on otherwise unconstrained inputs,
    1.32 -        e.g. to prevent denial of service attacks, to guard against running out of memory, or to work around
    1.33 -        platform-specific limitations.
    1.34 +        User agents MAY impose implementation-specific limits on otherwise unconstrained inputs, e.g. to prevent denial
    1.35 +        of service attacks, to guard against running out of memory, or to work around platform-specific limitations.
    1.36        </p>
    1.37        <p>
    1.38          When support for a feature is disabled (e.g. as an emergency measure to mitigate a security problem, or to aid
    1.39 -        in development, or for performance reasons), user agents MUST act as if they had no support
    1.40 -        for the feature whatsoever, and as if the feature was not mentioned in this specification. For example, if a
    1.41 -        particular feature is accessed via an attribute in a Web IDL interface, the attribute itself would be omitted
    1.42 -        from the objects that implement that interface - leaving the attribute on the object but making it return null
    1.43 -        or throw an exception is insufficient.
    1.44 +        in development, or for performance reasons), user agents MUST act as if they had no support for the feature
    1.45 +        whatsoever, and as if the feature was not mentioned in this specification. For example, if a particular feature
    1.46 +        is accessed via an attribute in a Web IDL interface, the attribute itself would be omitted from the objects
    1.47 +        that implement that interface - leaving the attribute on the object but making it return null or throw an
    1.48 +        exception is insufficient.
    1.49        </p>
    1.50        <section>
    1.51          <h3>
    1.52 @@ -357,8 +356,7 @@
    1.53            <p>
    1.54              When the <dfn id="dom-navigator-getnetworkservices"
    1.55                 title="dom-navigator-getnetworkservices"><code>getNetworkServices(type, successCallback[,
    1.56 -               errorCallback])</code></dfn> method is called, the <a>user agent</a> MUST run the
    1.57 -               following steps:
    1.58 +               errorCallback])</code></dfn> method is called, the <a>user agent</a> MUST run the following steps:
    1.59            </p>
    1.60            <ol class="rule">
    1.61              <li>Let <var>requested control types</var> be initially set to an empty array.
    1.62 @@ -408,8 +406,8 @@
    1.63                  </li>
    1.64                </ol>
    1.65              </li>
    1.66 -            <li>If <var>services found</var> is an empty array, then the <a>user agent</a> MUST
    1.67 -            <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
    1.68 +            <li>If <var>services found</var> is an empty array, then the <a>user agent</a> MUST <a href=
    1.69 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
    1.70                    class="externalDFN">queue a task</a> to invoke <var>errorCallback</var>, if it is provided and is an
    1.71                    object of type <code>Function</code>, with a new <a href=
    1.72                    "#navigatornetworkserviceerror"><code>NavigatorNetworkServiceError</code></a> object whose <a href=
    1.73 @@ -431,9 +429,8 @@
    1.74                    "#dom-navigatornetworkserviceerror-permission_denied"><code>PERMISSION_DENIED_ERR</code></a>) as its
    1.75                    argument, abort any remaining steps and return.
    1.76              </li>
    1.77 -            <li>The <a>user agent</a> MUST prompt the user in a user-agent-specific manner for
    1.78 -            permission to provide the <a href=
    1.79 -            "http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
    1.80 +            <li>The <a>user agent</a> MUST prompt the user in a user-agent-specific manner for permission to provide
    1.81 +            the <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
    1.82                    class="externalDFN">entry script</a>'s <a href=
    1.83                    "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
    1.84                    class="externalDFN">origin</a> with an array of <a href=
    1.85 @@ -477,11 +474,16 @@
    1.86              </li>
    1.87              <li>Set <var>services manager</var>'s <a href=
    1.88              "#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute to the number of
    1.89 -            services currently found in the <a>list of available service records</a> whose <code>type</code> property
    1.90 +            items currently found in the <a>list of available service records</a> whose <code>type</code> property
    1.91              matches any of the tokens requested in <var>requested control types</var>.
    1.92              </li>
    1.93 -            <li>Add the set of <var>services</var> to the <a>list of authorized service records</a> internally against
    1.94 -            the newly created <var>services manager</var> object.
    1.95 +            <li>Add <var>services</var> to the <var>services manager</var> object as its collection of <a>indexed
    1.96 +            properties</a>.
    1.97 +            </li>
    1.98 +            <li>Set <var>services manager</var>'s <a href="#dom-networkservices-length"><code>length</code></a>
    1.99 +            attribute to the number of items in <var>services</var>.
   1.100 +            </li>
   1.101 +            <li>Add <var>services manager</var> to the <a>list of active service managers</a>.
   1.102              </li>
   1.103              <li>The <a>user agent</a> MUST <a href=
   1.104              "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   1.105 @@ -499,9 +501,9 @@
   1.106            </p>
   1.107            <p>
   1.108              When a <a href="#networkservice"><code>NetworkService</code></a> object is provided to a Web page, the
   1.109 -            <a>user agent</a> MUST add the <code>url</code> property to the <dfn>entry script
   1.110 -            origin's URL whitelist</dfn>. This list enables the Web page to override and initiate cross-site resource
   1.111 -            requests towards these URLs, and any sub-resources of these URLs, within the current <a href=
   1.112 +            <a>user agent</a> MUST add the <code>url</code> property to the <dfn>entry script origin's URL
   1.113 +            whitelist</dfn>. This list enables the Web page to override and initiate cross-site resource requests
   1.114 +            towards these URLs, and any sub-resources of these URLs, within the current <a href=
   1.115              "http://www.whatwg.org/specs/web-apps/current-work/complete/browsers.html#entry-script"
   1.116                 class="externalDFN">entry script</a>'s <a href=
   1.117                 "http://www.whatwg.org/specs/web-apps/current-work/complete/origin-0.html#origin"
   1.118 @@ -617,8 +619,8 @@
   1.119            </dt>
   1.120            <dd>
   1.121              <p>
   1.122 -              Returns the current number of services belonging in the respective object's <a>list of authorized service
   1.123 -              records</a>.
   1.124 +              Returns the current number of items in the current object's collection of <a href=
   1.125 +              "#networkservice"><code>NetworkService</code></a> objects.
   1.126              </p>
   1.127            </dd>
   1.128            <dt>
   1.129 @@ -627,22 +629,21 @@
   1.130            </dt>
   1.131            <dd>
   1.132              <p>
   1.133 -              Returns the current number of services matching one of the app-requested <a>valid service type</a> tokens
   1.134 -              in the <a>list of available service records</a>.
   1.135 +              Returns the current number of items matching one of the app-requested <a>valid service type</a> tokens in
   1.136 +              the <a>list of available service records</a>.
   1.137              </p>
   1.138            </dd>
   1.139          </dl>
   1.140          <div>
   1.141            <p>
   1.142 -            The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute MUST
   1.143 -            return the number of services represented in the object's corresponding <a>list of authorized service
   1.144 -            records</a> at the time of getting.
   1.145 +            The <dfn id="dom-networkservices-length"><code>length</code></dfn> attribute MUST return the number of
   1.146 +            <a href="#networkservice"><code>NetworkService</code></a> objects represented by the collection.
   1.147            </p>
   1.148            <p>
   1.149 -            The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute
   1.150 -            MUST return the number of services in the <a>list of available service records</a>
   1.151 -            whose <code>type</code> attribute matches any of the <a>valid service type</a> tokens that was initially
   1.152 -            used to create the current <a href="#networkservices"><code>NetworkServices</code></a> object.
   1.153 +            The <dfn id="dom-networkservices-servicesavailable"><code>servicesAvailable</code></dfn> attribute MUST
   1.154 +            return the number of services in the <a>list of available service records</a> whose <code>type</code>
   1.155 +            attribute matches any of the <a>valid service type</a> tokens that was initially used to create the current
   1.156 +            <a href="#networkservices"><code>NetworkServices</code></a> object.
   1.157            </p>
   1.158          </div>
   1.159        </section>
   1.160 @@ -673,11 +674,10 @@
   1.161            </dd>
   1.162          </dl>
   1.163          <p>
   1.164 -          A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current list of one or
   1.165 -          more current authorized services - the <a>list of authorized service records</a>. Each item in the <a>list of
   1.166 -          authorized service records</a> is represented by a <a href="#networkservice"><code>NetworkService</code></a>
   1.167 -          object. The <a>list of authorized service records</a> is <span>immutable</span> meaning that it cannot be
   1.168 -          modified for the lifetime of a <a href="#networkservices"><code>NetworkServices</code></a> object.
   1.169 +          A <a href="#networkservices"><code>NetworkServices</code></a> object represents the current collection of one
   1.170 +          or more <a href="#networkservice"><code>NetworkService</code></a> objects. A <a href=
   1.171 +          "#networkservices"><code>NetworkServices</code></a> object is <span>immutable</span> meaning that it cannot
   1.172 +          be modified.
   1.173          </p>
   1.174          <p class="note">
   1.175            Each service in a <a href="#networkservices"><code>NetworkServices</code></a> object thus has an index; the
   1.176 @@ -688,25 +688,23 @@
   1.177            "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#supported-property-indices"
   1.178               class="externalDFN">supported property indices</a> of <a href=
   1.179               "#networkservices"><code>NetworkServices</code></a> objects at any instant are the numbers from zero to
   1.180 -             the number of items in the <a>list of authorized service records</a> represented by the respective object
   1.181 -             minus one, if any services are represented in the <a>list of authorized service records</a>.
   1.182 +             the number of the <a href="#networkservice"><code>NetworkService</code></a> objects in the collection
   1.183 +             minus one.
   1.184          </p>
   1.185          <p>
   1.186            To <a href=
   1.187            "http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#determine-the-value-of-an-indexed-property"
   1.188               class="externalDFN">determine the value of an indexed property</a> for a given index <var>index</var> in a
   1.189 -             <a href="#networkservices"><code>NetworkServices</code></a> object's <a>list of authorized service
   1.190 -             records</a>, the user agent MUST return the <a href=
   1.191 -             "#networkservice"><code>NetworkService</code></a> object that represents the <var>index</var>th service in
   1.192 -             the <a>list of authorized service records</a>.
   1.193 +             <a href="#networkservices"><code>NetworkServices</code></a> object the user agent MUST return the <a href=
   1.194 +             "#networkservice"><code>NetworkService</code></a> object that represents the <var>index</var>th item in
   1.195 +             the collection.
   1.196          </p>
   1.197          <p>
   1.198            The <dfn id="dom-networkservices-getservicebyid"><code>getServiceById(id)</code></dfn> method <em class=
   1.199            "ct">MUST</em> return the first <a href="#networkservice"><code>NetworkService</code></a> object in the
   1.200 -          <a>list of authorized service records</a> represented by the respective object whose <a href=
   1.201 -          "#dom-networkservice-id"><code>id</code></a> attribute is equal to the value of the <var>id</var> argument.
   1.202 -          When no services in the <a>list of authorized service records</a> match the given argument, the method
   1.203 -          MUST return null.
   1.204 +          collection whose <a href="#dom-networkservice-id"><code>id</code></a> attribute is equal to the value of the
   1.205 +          <var>id</var> argument provided. When no <a href="#networkservice"><code>NetworkService</code></a> objects
   1.206 +          match the given argument, the method MUST return null.
   1.207          </p>
   1.208          <p>
   1.209            Services available within the local network can connect and disconnect at different times during the
   1.210 @@ -847,8 +845,8 @@
   1.211          </dl>
   1.212          <p>
   1.213            The <dfn id="dom-networkservice-id"><code>id</code></dfn> attribute is a unique identifier for the service.
   1.214 -          The same service provided at different times or on different objects MUST have the same
   1.215 -          <a href="#dom-networkservice-id"><code>id</code></a> value.
   1.216 +          The same service provided at different times or on different objects MUST have the same <a href=
   1.217 +          "#dom-networkservice-id"><code>id</code></a> value.
   1.218          </p>
   1.219          <p>
   1.220            The <dfn id="dom-networkservice-name"><code>name</code></dfn> attribute represents a human-readable title for
   1.221 @@ -955,34 +953,38 @@
   1.222        <p>
   1.223          A <a>user agent</a> conforming to this specification MAY implement <abbr title=
   1.224          "Simple Service Discovery Protocol">SSDP</abbr> [[!UPNP-DEVICEARCH11]] and Zeroconf [[!DNS-SD]] + [[!MDNS]]
   1.225 -        service discovery mechanisms to enable Web pages to request and connect with HTTP services running on networked
   1.226 -        devices, discovered via either mechanism, through this API. When a <a>user agent</a> implements either of these
   1.227 -        service discovery mechanisms, then it MUST conform to the corresponding algorithms provided
   1.228 -        in this section of the specification.
   1.229 +        <dfn>service discovery mechanisms</dfn> - the requirements detailed in this section of the specification - to
   1.230 +        enable Web pages to request and connect with HTTP services running on networked devices, discovered via either
   1.231 +        mechanism, through this API. When a <a>user agent</a> implements either of these <a>service discovery
   1.232 +        mechanisms</a>, then it MUST conform to the corresponding algorithms provided in this section of the
   1.233 +        specification.
   1.234        </p>
   1.235        <p>
   1.236 -        This section presents how the results of these two service discovery mechanisms will be matched to requested
   1.237 -        service types, how the user agent stores available and active services, how their properties are applied to any
   1.238 -        resulting <a href="#networkservice"><code>NetworkService</code></a> objects.
   1.239 +        This section presents how the results of these two <a>service discovery mechanisms</a> will be matched to
   1.240 +        requested service types, how the user agent stores available and active services, how their properties are
   1.241 +        applied to any resulting <a href="#networkservice"><code>NetworkService</code></a> objects.
   1.242        </p>
   1.243        <p>
   1.244 -        It is expected that user agents will perform these service discovery mechanisms asynchronously and
   1.245 -        periodically update the <a>list of networked devices</a> as required. The timing of any service discovery
   1.246 -        mechanisms is an implementation detail left to the discretion of the implementer (e.g. once on user agent
   1.247 -        start-up, every X seconds during user agent execution or on invocation of this API from a Web page).
   1.248 +        It is expected that user agents will perform these <a>service discovery mechanisms</a> asynchronously and
   1.249 +        periodically update the <a>list of available service records</a> as required. The timing of any <a>service
   1.250 +        discovery mechanisms</a> is an implementation detail left to the discretion of the implementer (e.g. by
   1.251 +        continuously monitoring the network as a background process or on invocation of this API from a Web page).
   1.252        </p>
   1.253        <p>
   1.254          The <dfn>list of available service records</dfn> is a single dynamic internal lookup table within user agents
   1.255          that is used to track all the services that have been discovered and are available in the current network at
   1.256 -        any given time. At any point during the running of either of the two service discovery mechanisms then existing
   1.257 -        entries within this table can be updated, entries can be added and entries can be removed as the status of
   1.258 -        networked services changes according to the rules defined in this specification.
   1.259 +        any given time. At any point during the running of either of the two <a>service discovery mechanisms</a> then
   1.260 +        existing entries within this table can be updated, entries can be added and entries can be removed as the
   1.261 +        status of networked services changes according to the rules defined in this specification.
   1.262        </p>
   1.263        <p>
   1.264 -        The <dfn>list of authorized service records</dfn> is a single dynamic internal lookup table within user agents
   1.265 -        that is used to track the current services that are being shared with web pages at any given time from the
   1.266 -        <a>list of available service records</a>. Each record in the <a>list of authorized service records</a> is
   1.267 -        associated with a <var>services manager</var> object that is assigned as part of the <a href=
   1.268 +        The <dfn>list of active service managers</dfn> is an internal list within user agents that is used to track all
   1.269 +        <a href="#networkservices"><code>NetworkServices</code></a> objects currently being shared with any web pages
   1.270 +        at the current time. Each <a href="#networkservices"><code>NetworkServices</code></a> object in the <a>list of
   1.271 +        active service managers</a> represents a collection of one or more <a href=
   1.272 +        "#networkservice"><code>NetworkService</code></a> objects - known as its <dfn>indexed properties</dfn>.
   1.273 +        <a href="#networkservice"><code>NetworkService</code></a> objects are attached as the <a>indexed properties</a>
   1.274 +        of a <a href="#networkservices"><code>NetworkServices</code></a> object as part of the <a href=
   1.275          "#dom-navigator-getnetworkservices"><code>getNetworkServices()</code></a> algorithm.
   1.276        </p>
   1.277        <p>
   1.278 @@ -1009,35 +1011,44 @@
   1.279            </ol>
   1.280          </li>
   1.281          <li>If <var>new service registration flag</var> is set to <code>true</code> then add <var>network service
   1.282 -        record</var> to the <a>list of available service records</a> as a new entry.
   1.283 +        record</var> to the <a>list of available service records</a> as a new item.
   1.284          </li>
   1.285 -        <li>For each <var>active service</var> in the <a>list of authorized service records</a> run the following
   1.286 -        steps:
   1.287 +        <li>For each <var>service manager</var> in the <a>list of active service managers</a> run the following steps:
   1.288            <ol class="rule">
   1.289 -            <li>If <var>network service record</var>'s <code>type</code> property does not equal the current
   1.290 -            <var>active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
   1.291 -            <var>active service</var> and continue at the next available <var>active service</var>.
   1.292 +            <li>Let <var>service type in current service manager flag</var> be <code>false</code>.
   1.293              </li>
   1.294 -            <li>If the <var>new service registration flag</var> is set to <code>true</code> then increment the
   1.295 -              <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute of the
   1.296 -              <var>services manager</var> associated with the current <var>active service</var> object by
   1.297 -              <code>1</code> and then <a href=
   1.298 -              "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   1.299 +            <li>For each <var>active service</var> in <var>service manager</var> run the following steps:
   1.300 +              <ol class="rule">
   1.301 +                <li>If <var>network service record</var>'s <code>type</code> property does not equal <var>active
   1.302 +                service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this <var>active
   1.303 +                service</var> and continue at the next available <var>active service</var>.
   1.304 +                </li>
   1.305 +                <li>Set the <var>service type in current service manager flag</var> to <code>true</code>.
   1.306 +                </li>
   1.307 +                <li>If the <var>new service registration flag</var> is set to <code>false</code>, the <var>network
   1.308 +                service record</var>'s <code>id</code> property equals the <var>active service</var>'s <code>id</code>
   1.309 +                attribute and <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a>
   1.310 +                attribute is currently set to <code>false</code> then set <var>active service</var>'s <a href=
   1.311 +                "#dom-networkservice-online"><code>online</code></a> attribute to <code>true</code> and then <a href=
   1.312 +                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   1.313 +                      class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   1.314 +                      "#event-serviceonline"><code>serviceonline</code></a> that uses the <a href=
   1.315 +                      "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   1.316 +                      class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
   1.317 +                      and has no default action, at the current <var>active service</var> object.
   1.318 +                </li>
   1.319 +              </ol>
   1.320 +            </li>
   1.321 +            <li>If the <var>new service registration flag</var> is set to <code>true</code> and the <var>service type
   1.322 +            in current service manager flag</var> is also set to <code>true</code> then increment <var>service
   1.323 +            manager</var>'s <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a>
   1.324 +            attribute by <code>1</code> and then <a href=
   1.325 +            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   1.326                    class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   1.327                    "#event-serviceavailable"><code>serviceavailable</code></a> that uses the <a href=
   1.328                    "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   1.329                    class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable, and
   1.330 -                  has no default action, at the <var>services manager</var> associated with the current <var>active
   1.331 -                  service</var> object.
   1.332 -            </li>
   1.333 -            <li>Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a> attribute
   1.334 -            to <code>true</code> and then <a href=
   1.335 -            "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   1.336 -                  class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   1.337 -                  "#event-serviceonline"><code>serviceonline</code></a> that uses the <a href=
   1.338 -                  "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   1.339 -                  class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable, and
   1.340 -                  has no default action, at the current <var>active service</var> object.
   1.341 +                  has no default action, at the current <var>service manager</var> object.
   1.342              </li>
   1.343            </ol>
   1.344          </li>
   1.345 @@ -1061,32 +1072,43 @@
   1.346              result of having previously called <a>setup a UPnP Events Subscription</a> against the current
   1.347              <var>existing service record</var>).
   1.348              </li>
   1.349 -            <li>For each <var>active service</var> in <a>list of authorized service records</a> run the following
   1.350 +            <li>For each <var>service manager</var> in the <a>list of active service managers</a> run the following
   1.351              steps:
   1.352                <ol class="rule">
   1.353 -                <li>If <var>existing service record</var>'s <code>type</code> property does not equal the current <var>
   1.354 -                  active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
   1.355 -                  <var>active service</var> and continue at the next available <var>active service</var>.
   1.356 +                <li>Let <var>service type in current service manager flag</var> be <code>false</code>.
   1.357                  </li>
   1.358 -                <li>Decrement the <a href="#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a>
   1.359 -                attribute of the <var>services manager</var> associated with the current <var>active service</var>
   1.360 -                object by <code>1</code> and then <a href=
   1.361 +                <li>For each <var>active service</var> in <var>service manager</var> run the following steps:
   1.362 +                  <ol class="rule">
   1.363 +                    <li>If <var>existing service record</var>'s <code>type</code> property does not equal the
   1.364 +                    <var>active service</var>'s <code>type</code> attribute then abort any remaining sub-steps for this
   1.365 +                    <var>active service</var> and continue at the next available <var>active service</var>.
   1.366 +                    </li>
   1.367 +                    <li>Set the <var>service type in current service manager flag</var> to <code>true</code>.
   1.368 +                    </li>
   1.369 +                    <li>If <var>existing service record</var>'s <code>id</code> property equals the <var>active
   1.370 +                    service</var>'s <code>id</code> attribute and <var>active service</var>'s <a href=
   1.371 +                    "#dom-networkservice-online"><code>online</code></a> attribute is currently set to
   1.372 +                    <code>true</code> then set <var>active service</var>'s <a href="#dom-networkservice-online"><code>
   1.373 +                      online</code></a> attribute to <code>false</code> and then <a href=
   1.374 +                      "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   1.375 +                          class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   1.376 +                          "#event-serviceoffline"><code>serviceoffline</code></a> that uses the <a href=
   1.377 +                          "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   1.378 +                          class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not
   1.379 +                          cancellable, and has no default action, at the current <var>active service</var>.
   1.380 +                    </li>
   1.381 +                  </ol>
   1.382 +                </li>
   1.383 +                <li>If the <var>service type in current service manager flag</var> is set to <code>true</code> then
   1.384 +                decrement <var>service manager</var>'s <a href=
   1.385 +                "#dom-networkservices-servicesavailable"><code>servicesAvailable</code></a> attribute by <code>1</code>
   1.386 +                and then <a href=
   1.387                  "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   1.388                        class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   1.389                        "#event-serviceunavailable"><code>serviceunavailable</code></a> that uses the <a href=
   1.390                        "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   1.391                        class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
   1.392 -                      and has no default action, at the <var>services manager</var> associated with the current
   1.393 -                      <var>active service</var> object.
   1.394 -                </li>
   1.395 -                <li>Set <var>active service</var>'s <a href="#dom-networkservice-online"><code>online</code></a>
   1.396 -                attribute to <code>false</code> and then <a href=
   1.397 -                "http://www.whatwg.org/specs/web-apps/current-work/complete/webappapis.html#queue-a-task"
   1.398 -                      class="externalDFN">queue a task</a> to dispatch a newly created event with the name <a href=
   1.399 -                      "#event-serviceoffline"><code>serviceoffline</code></a> that uses the <a href=
   1.400 -                      "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   1.401 -                      class="externalDFN"><code>Event</code></a> interface, which does not bubble, is not cancellable,
   1.402 -                      and has no default action, at the current <var>active service</var> object.
   1.403 +                      and has no default action, at the current <var>service manager</var> object.
   1.404                  </li>
   1.405                </ol>
   1.406              </li>
   1.407 @@ -1096,10 +1118,10 @@
   1.408          </li>
   1.409        </ol>
   1.410        <p>
   1.411 -        User agents SHOULD expire a service record from the <a>list of available service
   1.412 -        records</a> when its <code>expiryTimestamp</code> attribute exceeds the current UTC timestamp. When this
   1.413 -        condition is met the <a>user agent</a> SHOULD run the rule for <a>removing an available service</a>, passing in
   1.414 -        the expired service record's <code>id</code> attribute as the only argument.
   1.415 +        User agents SHOULD expire a service record from the <a>list of available service records</a> when its
   1.416 +        <code>expiryTimestamp</code> attribute exceeds the current UTC timestamp. When this condition is met the
   1.417 +        <a>user agent</a> SHOULD run the rule for <a>removing an available service</a>, passing in the expired service
   1.418 +        record's <code>id</code> attribute as the only argument.
   1.419        </p>
   1.420        <section>
   1.421          <h4>
   1.422 @@ -1109,8 +1131,7 @@
   1.423          <p>
   1.424            For each DNS response received from a user-agent-initiated Multicast DNS Browse for <abbr title=
   1.425            "DNS Pointer Record">PTR</abbr> records with the name <code>_services._dns-sd._udp</code> on the resolved
   1.426 -          recommended automatic browsing domain [[!MDNS]], the <a>user agent</a> MUST run the
   1.427 -          following steps:
   1.428 +          recommended automatic browsing domain [[!MDNS]], the <a>user agent</a> MUST run the following steps:
   1.429          </p>
   1.430          <ol class="rule">
   1.431            <li>Let <var>service mDNS responses</var> be an array of PTR records received by issuing a Multicast DNS
   1.432 @@ -1156,38 +1177,37 @@
   1.433            Simple Service Discovery Protocol (<abbr title="Simple Service Discovery Protocol">SSDP</abbr>)
   1.434          </h5>
   1.435          <p>
   1.436 -          A user agent that implements UPnP service discovery MUST issue an <dfn>advertisement for
   1.437 -          UPnP root devices</dfn> against the user's current local network according to the full normative text and
   1.438 -          timing provided in 'Section 1.3.2: Search request with M-SEARCH' detailed in [[!UPNP-DEVICEARCH11]].
   1.439 +          A user agent that implements UPnP service discovery MUST issue a <dfn>search request for UPnP root
   1.440 +          devices</dfn> against the user's current local network according to the full normative text and timing
   1.441 +          provided in 'Section 1.3.2: Search request with M-SEARCH' detailed in [[!UPNP-DEVICEARCH11]].
   1.442          </p>
   1.443          <p>
   1.444 -          The user agent MUST issue all <a title=
   1.445 -          "advertisement for UPnP root devices">advertisements for UPnP root devices</a> with a HTTP request line equal
   1.446 -          to <code>M-SEARCH * HTTP/1.1</code>, with a HOST header equal to the reserved multicast address and port of
   1.447 -          <code>239.255.255.250:1900</code>, a MAN header equal to <code>ssdp:discover</code>, an ST header equal to
   1.448 -          <code>upnp:rootdevice</code> and a user-agent defined MX header equal to a <dfn>maximum UPnP advertisement
   1.449 -          response wait time</dfn> value between <code>1</code> and <code>5</code> seconds.
   1.450 +          The user agent MUST issue all <a title="search request for UPnP root devices">search requests for UPnP root
   1.451 +          devices</a> with a HTTP request line equal to <code>M-SEARCH * HTTP/1.1</code>, with a HOST header equal to
   1.452 +          the reserved multicast address and port of <code>239.255.255.250:1900</code>, a MAN header equal to
   1.453 +          <code>ssdp:discover</code>, an ST header equal to <code>upnp:rootdevice</code> and a user-agent defined MX
   1.454 +          header equal to a <dfn>maximum UPnP advertisement response wait time</dfn> value between <code>1</code> and
   1.455 +          <code>5</code> seconds.
   1.456          </p>
   1.457          <p>
   1.458 -          The user agent MUST listen for incoming requests and process any incoming responses to
   1.459 -          any <a>advertisement for UPnP root devices</a> on the <dfn>standard UPnP address and port</dfn>, on all
   1.460 -          current local network interface addresses with the port <code>1900</code>, according to the rules defined in
   1.461 -          this section.
   1.462 +          The user agent MUST listen for any incoming responses to any <a>search request for UPnP root devices</a>.
   1.463          </p>
   1.464          <p>
   1.465 -          For each <dfn>HTTP Response</dfn> following an initial <a>advertisement for UPnP root devices</a> sent on a
   1.466 +          For each <dfn>HTTP Response</dfn> following an initial <a>search request for UPnP root devices</a> sent on a
   1.467            <a>standard UPnP address and port</a> the user agent MUST run the following steps:
   1.468          </p>
   1.469          <ol class="rule">
   1.470            <li>If the <a>HTTP Response</a> is not a HTTP 200 OK response then this response is invalid and the user
   1.471 -          agent MUST discard this response, abort any remaining steps and return. The user agent
   1.472 -          MAY issue a new <a>advertisement for UPnP root devices</a> as a result of this error
   1.473 +          agent MUST discard this response, abort any remaining steps and return. The user agent MAY issue a new
   1.474 +          <a>search request for UPnP root devices</a> as a result of this error occurring.
   1.475 +          </li>
   1.476 +          <li>If the <a>maximum UPnP advertisement response wait time</a> has been exceeded since the initial <a>search
   1.477 +          request for UPnP root devices</a> was sent then the <a>HTTP Response</a> is invalid and the user agent MUST
   1.478 +          discard this response, abort any remaining steps and return. The user agent MAY stop listening for responses
   1.479 +          from the current <a>search request for UPnP root devices</a> as a result of this error occurring. Equally,
   1.480 +          the user agent MAY issue a new <a>search request for UPnP root devices</a> as a result of this error
   1.481            occurring.
   1.482            </li>
   1.483 -          <li>If the <a>maximum UPnP advertisement response wait time</a> has been exceeded since the initial
   1.484 -          <a>advertisement for UPnP root devices</a> was sent then the <a>HTTP Response</a> is invalid and the user
   1.485 -          agent MUST discard this response, abort any remaining steps and return.
   1.486 -          </li>
   1.487            <li>Let <var>ssdp device</var> be an Object with a property for each HTTP header received in the <a>HTTP
   1.488            Response</a>, with each key being the name of a HTTP response header and each value being that HTTP response
   1.489            header's value.
   1.490 @@ -1195,24 +1215,26 @@
   1.491            <li>If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one
   1.492            <var>USN</var> entry, at least one <var>ST</var> entry and at least one <var>LOCATION</var> entry or the
   1.493            value of its <var>ST</var> entry is not <code>upnp:rootdevice</code>, then the <a>HTTP Response</a> is
   1.494 -          invalid and the <a>user agent</a> MUST discard this response, abort any remaining steps
   1.495 -          and return.
   1.496 +          invalid and the <a>user agent</a> MUST discard this response, abort any remaining steps and return.
   1.497            </li>
   1.498 -          <li>The user agent MUST run the rule for <a>obtaining a UPnP Device Description File</a>
   1.499 -          passing in the first occurrence of <var>LOCATION</var> from <var>ssdp device</var> as the <var>device
   1.500 -          descriptor URL</var> argument and the first occurrence of <var>USN</var> from <var>ssdp device</var> as the
   1.501 -          <var>device identifier</var> argument and the first occurrence of <var>CACHE-CONTROL</var> from <var>ssdp
   1.502 -          device</var> as the <var>device expiry</var> argument.
   1.503 +          <li>The user agent MUST run the rule for <a>obtaining a UPnP Device Description File</a> passing in the first
   1.504 +          occurrence of <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor URL</var>
   1.505 +          argument and the first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device
   1.506 +          identifier</var> argument and the first occurrence of <var>CACHE-CONTROL</var> from <var>ssdp device</var>
   1.507 +          (minus the leading string of <code>max-age=</code>) as the <var>device expiry</var> argument.
   1.508            </li>
   1.509          </ol>
   1.510          <p>
   1.511 -          For each <dfn>HTTP Request</dfn> received on a <a>standard UPnP address and port</a> the user agent
   1.512 -          MUST run the following steps:
   1.513 +          The user agent MUST listen for incoming requests on the <dfn>standard UPnP address and port</dfn> on all
   1.514 +          current local network interface addresses with the port <code>1900</code>.
   1.515 +        </p>
   1.516 +        <p>
   1.517 +          For each <dfn>HTTP Request</dfn> received on a <a>standard UPnP address and port</a> the user agent MUST run
   1.518 +          the following steps:
   1.519          </p>
   1.520          <ol class="rule">
   1.521            <li>If the <a>HTTP Request</a> is not a HTTP NOTIFY request then it is not a valid UPnP Request and the user
   1.522 -          agent MUST return a HTTP 200 OK response, discard this request, abort any remaining steps
   1.523 -          and return.
   1.524 +          agent MUST discard this request, abort any remaining steps and return.
   1.525            </li>
   1.526            <li>Let <var>ssdp device</var> be an Object with a property for each HTTP header received in the <a>HTTP
   1.527            Request</a>, with each key being the name of a HTTP header and each value being that HTTP header's value.
   1.528 @@ -1220,20 +1242,20 @@
   1.529            <li>If <var>ssdp device</var> does not contain at least one <var>CACHE-CONTROL</var> entry, at least one
   1.530            <var>USN</var> entry, at least one <var>NT</var> entry, at least one <var>NTS</var> entry and at least one
   1.531            <var>LOCATION</var> entry or the value of its <var>NT</var> entry is not <code>upnp:rootdevice</code>, then
   1.532 -          the <a>HTTP Request</a> is a malformed UPnP Request and the <a>user agent</a> MUST return
   1.533 -          a 400 Bad Request response, discard this request, abort any remaining steps and return.
   1.534 +          the <a>HTTP Request</a> is a malformed UPnP Request and the <a>user agent</a> MUST discard this request,
   1.535 +          abort any remaining steps and return.
   1.536            </li>
   1.537 -          <li>If <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:alive</code> or
   1.538 -          <code>ssdp:update</code> then the user agent MUST run the rule for <a>obtaining a UPnP
   1.539 -          Device Description File</a> passing in the first occurrence of <var>LOCATION</var> from <var>ssdp
   1.540 -          device</var> as the <var>device descriptor URL</var> argument and the first occurrence of <var>USN</var> from
   1.541 -          <var>ssdp device</var> as the <var>device identifier</var> argument and the first occurrence of
   1.542 -          <var>CACHE-CONTROL</var> from <var>ssdp device</var> as the <var>device expiry</var>.<br>
   1.543 +          <li>If <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:alive</code> then the user agent
   1.544 +          MUST run the rule for <a>obtaining a UPnP Device Description File</a> passing in the first occurrence of
   1.545 +          <var>LOCATION</var> from <var>ssdp device</var> as the <var>device descriptor URL</var> argument and the
   1.546 +          first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var> argument
   1.547 +          and the first occurrence of <var>CACHE-CONTROL</var> from <var>ssdp device</var> (minus the leading string of
   1.548 +          <code>max-age=</code>) as the <var>device expiry</var>.<br>
   1.549              <br>
   1.550              Otherwise, if <var>ssdp device</var>'s <var>NTS</var> entry is equal to <code>ssdp:byebye</code> then the
   1.551 -            user agent MUST run the rule for <a>removing all services from a registered UPnP
   1.552 -            Device</a> passing in the first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device
   1.553 -            identifier</var> argument.
   1.554 +            user agent MUST run the rule for <a>removing all services from a registered UPnP Device</a> passing in the
   1.555 +            first occurrence of <var>USN</var> from <var>ssdp device</var> as the <var>device identifier</var>
   1.556 +            argument.
   1.557            </li>
   1.558          </ol>
   1.559          <p>
   1.560 @@ -1248,19 +1270,12 @@
   1.561            description using HTTP' in [[!UPNP-DEVICEARCH11]].
   1.562            </li>
   1.563            <li>If the value provided in <var>device descriptor URL</var> cannot be resolved as a reachable URL on the
   1.564 -          current network or the <var>root device descriptor file</var> remains empty then it is invalid and the
   1.565 -          <a>user agent</a> MUST abort any remaining steps and return.
   1.566 +          current network or the <var>device descriptor file</var> remains empty then it is invalid and the <a>user
   1.567 +          agent</a> MUST abort any remaining steps and return.
   1.568            </li>
   1.569            <li>Run the rule for <a>processing a UPnP Device Description File</a>, passing in the current <var>device
   1.570            descriptor file</var>, <var>device identifier</var> and <var>device expiry</var> arguments.
   1.571            </li>
   1.572 -          <li>If the current <var>device descriptor file</var> contains a <code>&lt;deviceList&gt;</code> element then
   1.573 -          for each <code>&lt;device&gt;</code> element within <code>&lt;deviceList&gt;</code> - herein known as an
   1.574 -          <var>embedded device descriptor file</var> - the user agent MUST run the rule for
   1.575 -          <a>processing a UPnP Device Description File</a>, passing in the current <var>embedded device descriptor
   1.576 -          file</var> as the <var>device descriptor file</var> argument, along with the common <var>device
   1.577 -          identifier</var> and <var>device expiry</var> arguments.
   1.578 -          </li>
   1.579          </ol>
   1.580          <p>
   1.581            The rule for <dfn>processing a UPnP Device Description File</dfn> is the process of parsing the contents of a
   1.582 @@ -1269,8 +1284,8 @@
   1.583          </p>
   1.584          <p>
   1.585            The rule for <a>processing a UPnP Device Description File</a> takes three arguments - <var>device descriptor
   1.586 -          file</var>, <var>device identifier</var> and <var>device expiry</var> - and when called the user agent
   1.587 -          MUST run the following steps:
   1.588 +          file</var>, <var>device identifier</var> and <var>device expiry</var> - and when called the user agent MUST
   1.589 +          run the following steps:
   1.590          </p>
   1.591          <ol class="rule">
   1.592            <li>Let <var>advertised services</var> be a list of all advertised services obtained from the <var>device
   1.593 @@ -1285,8 +1300,8 @@
   1.594                <code>eventsUrl</code>, <code>config</code>, <code>expiryTimestamp</code>.
   1.595                </li>
   1.596                <li>Set <var>network service record</var>'s <code>id</code> property to the concatenated string value of
   1.597 -              <var>device identifier</var> with the <var>advertised service</var>'s <code>&lt;serviceId&gt;</code>
   1.598 -              sub-element.
   1.599 +              the first occurrence of the <code>&lt;UDN&gt;</code> element in the <var>device descriptor file</var>
   1.600 +              with the <var>advertised service</var>'s <code>&lt;serviceId&gt;</code> sub-element.
   1.601                </li>
   1.602                <li>Set <var>network service record</var>'s <code>deviceId</code> property to the value of <var>device
   1.603                identifier</var>.
   1.604 @@ -1318,6 +1333,13 @@
   1.605                </li>
   1.606              </ol>
   1.607            </li>
   1.608 +          <li>If <var>device descriptor file</var> contains a <code>&lt;deviceList&gt;</code> element then for each
   1.609 +          <code>&lt;device&gt;</code> element within <code>&lt;deviceList&gt;</code> - herein known as an <var>embedded
   1.610 +          device descriptor file</var> - the user agent MUST run the rule for <a>processing a UPnP Device Description
   1.611 +          File</a>, passing in the current <var>embedded device descriptor file</var> as the <var>device descriptor
   1.612 +          file</var> argument, along with the current <var>device identifier</var> and <var>device expiry</var>
   1.613 +          arguments.
   1.614 +          </li>
   1.615          </ol>
   1.616          <p>
   1.617            The rule for <dfn>removing all services from a registered UPnP Device</dfn> is the process of removing all
   1.618 @@ -1356,8 +1378,8 @@
   1.619            string value of <var>callback URL</var> towards the <var>network service record</var>'s
   1.620            <code>eventsUrl</code> property.
   1.621            </li>
   1.622 -          <li>If a non-200 OK response is received from the HTTP SUBSCRIBE request then the <a>user agent</a>
   1.623 -            MUST abort these steps.
   1.624 +          <li>If a non-200 OK response is received from the HTTP SUBSCRIBE request then the <a>user agent</a> MUST
   1.625 +          abort these steps.
   1.626            </li>
   1.627            <li>On receiving a valid 200 OK response, run the following steps:
   1.628              <ol class="rule">
   1.629 @@ -1384,8 +1406,12 @@
   1.630                    record</var>'s <code>eventsUrl</code> property.
   1.631                    </li>
   1.632                    <li>On receiving a valid 200 OK, update <var>callback ID</var> with the string value of the first
   1.633 -                  included <em>SID</em> header, if it exists. All other HTTP responses should cause the <a>user
   1.634 -                  agent</a> to continue from the step labeled <em>refresh subscription</em> above.
   1.635 +                  included <em>SID</em> header and set <var>timeout date</var> to the sum of the current UTC date value
   1.636 +                  plus the integer value of the first included <em>TIMEOUT</em> header (minus the leading string of
   1.637 +                  <code>Second-</code>), if it exists. If the current date is greater than or equal to <var>timeout
   1.638 +                  date</var> then the <a>user agent</a> SHOULD continue from the step labeled <em>refresh
   1.639 +                  subscription</em> above. For all non 200 OK responses the <a>user agent</a> SHOULD continue from the
   1.640 +                  step labeled <em>refresh subscription</em> above.
   1.641                    </li>
   1.642                  </ol>
   1.643                </li>
   1.644 @@ -1394,8 +1420,7 @@
   1.645                  agent</a> is to run the following steps:
   1.646                  <ol class="rule">
   1.647                    <li>Let <var>content clone</var> be the result of obtaining the message body of the HTTP NOTIFY
   1.648 -                  request. If <var>content clone</var> is empty, then the <a>user agent</a> MUST
   1.649 -                  abort these steps.
   1.650 +                  request. If <var>content clone</var> is empty, then the <a>user agent</a> MUST abort these steps.
   1.651                    </li>
   1.652                    <li>Let <var>notification event</var> be a new simple event that uses the <a href=
   1.653                    "http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#event"
   1.654 @@ -1411,18 +1436,19 @@
   1.655                          class="externalDFN">Queue a task</a> to dispatch <var>notification event</var> at the current
   1.656                          <a><code>NetworkService</code></a> object.
   1.657                    </li>
   1.658 +                  <li>Return a HTTP 200 OK response to the sender of the HTTP NOTIFY request.
   1.659 +                  </li>
   1.660                  </ol>
   1.661                </li>
   1.662              </ol>
   1.663            </li>
   1.664          </ol>
   1.665          <p>
   1.666 -          A <a>user agent</a> can <dfn>terminate an existing UPnP Events Subscription</dfn> at any time for any
   1.667 -          <var>active service</var> in the <a>list of authorized service records</a> by sending an HTTP UNSUBSCRIBE
   1.668 -          request - as defined in 'Section 4.1.4: Cancelling a subscription with UNSUBSCRIBE' in [[!UPNP-DEVICEARCH11]]
   1.669 -          - with a HOST header set to that <var>active service</var>'s <code>eventsUrl</code> property and a SID header
   1.670 -          set to the <var>callback ID</var> obtained when the initial <a>setup a UPnP Events Subscription</a> action
   1.671 -          occurred.
   1.672 +          A <a>user agent</a> can <dfn>terminate an existing UPnP Events Subscription</dfn> at any time for a
   1.673 +          <var>network service record</var> by sending an HTTP UNSUBSCRIBE request - as defined in 'Section 4.1.4:
   1.674 +          Cancelling a subscription with UNSUBSCRIBE' in [[!UPNP-DEVICEARCH11]] - with a HOST header set to that
   1.675 +          <var>active service</var>'s <code>eventsUrl</code> property and a SID header set to the <var>callback
   1.676 +          ID</var> obtained when the initial <a>setup a UPnP Events Subscription</a> action occurred.
   1.677          </p>
   1.678        </section>
   1.679        <section>
   1.680 @@ -1432,15 +1458,15 @@
   1.681          <div>
   1.682            <p>
   1.683              When the <a>user agent</a> detects that the user has dropped from their connected network then, for each
   1.684 -            <var>existing service record</var> in the <a>list of available service records</a>, the user agent
   1.685 -            MUST run the general rule for <a>removing an available service</a> passing in each
   1.686 -            <var>existing service record</var>'s <code>id</code> property as the only argument for each call.
   1.687 +            <var>existing service record</var> in the <a>list of available service records</a>, the user agent MUST run
   1.688 +            the general rule for <a>removing an available service</a> passing in each <var>existing service
   1.689 +            record</var>'s <code>id</code> property as the only argument for each call.
   1.690            </p>
   1.691            <p>
   1.692              When the <a>user agent</a> detects that the user has connected to a new network or reconnected to an
   1.693 -            existing network, then it SHOULD restart its discovery mechanisms as defined in the
   1.694 -            <a href="#service-discovery">Service Discovery</a> section of this specification, maintaining the existing
   1.695 -            <a>list of authorized service records</a> currently in use.
   1.696 +            existing network, then it SHOULD restart its discovery mechanisms as defined in the <a href=
   1.697 +            "#service-discovery">Service Discovery</a> section of this specification, maintaining the existing <a>list
   1.698 +            of active service managers</a> currently in use.
   1.699            </p>
   1.700          </div>
   1.701        </section>
   1.702 @@ -1538,10 +1564,18 @@
   1.703          Garbage collection
   1.704        </h3>
   1.705        <p>
   1.706 -        Only when the user navigates away from the current browsing context can <a><code>NetworkService</code></a>
   1.707 -        objects be garbage-collected, its records in the <a>entry script origin's URL whitelist</a> be removed and its
   1.708 -        corresponding entry in the <a>list of authorized service records</a> be removed according to passing each
   1.709 -        expired object identifier through the rule for <a>removing an available service</a>.
   1.710 +        A user agent MUST only garbage collect a <a><code>NetworkServices</code></a> object and remove its entry from
   1.711 +        the <a>list of active service managers</a> when the user has navigated away from the browsing context in which
   1.712 +        that <a><code>NetworkServices</code></a> object was provided.
   1.713 +      </p>
   1.714 +      <p>
   1.715 +        A user agent MUST NOT garbage collect individual <a><code>NetworkService</code></a> objects until their parent
   1.716 +        <a><code>NetworkServices</code></a> object has been garbage collected.
   1.717 +      </p>
   1.718 +      <p>
   1.719 +        A user agent MUST garbage collect the <a><code>NetworkService</code></a> <a>indexed properties</a> of a
   1.720 +        <a><code>NetworkServices</code></a> object when that <a><code>NetworkServices</code></a> object itself has been
   1.721 +        garbage-collected.
   1.722        </p>
   1.723      </section>
   1.724      <section>