1c1
< In order to satisfy the power saving non-functional requirement, the user agent must keep track of the number of Availability objects requested through the getAvailability() method. The UA may also keep track of whether the page holding the Availability object is in the foreground. Using this information, implementation specific discovery of presentation displays can be resumed or suspended, in order to save power.
---
> In order to satisfy the power saving non-functional requirement, the user agent must keep track of the number of EventHandlers registered to the onavailablechange event. Using this information, implementation specific discovery of presentation displays can be resumed or suspended, in order to save power.
3c3
< The user agent must keep a list of available presentation displays. According to the number of alive Availability objects, the user agent must also keep the list up to date by running the algorithm for monitoring the list of available presentation displays.
---
> The user agent must keep a list of available presentation displays. According to the number of event handlers for onavailablechange, the user agent must also keep the list up to date by running the algorithm for monitoring the list of available presentation displays.
5c5
< The user agent might not support continuous availability monitoring due to platform or power consumption restrictions, for example. In this case the Promise returned by getAvailability() is rejected and the algorithm for monitoring the list of available presentation displays will only run as part of the session start or join algorithms.
---
> 6.4.4.1 Adding an EventHandler to onavailablechange
7c7,14
< 6.4.1 Monitoring the list of available presentation displays
---
> When an event handler is added to the list of event handlers registered for the onavailablechange event, the user agent must run the algorithm to monitor the list of available presentation displays.
>
> 6.4.4.2 Removing an EventHandler
>
> When an event handler is removed from the list of event handlers registered to the onavailablechange event, the user agent must run the following steps:
>
> If the removed event handler was the last one in the list, cancel monitoring the list of available presentation displays.
> 6.4.4.3 Monitoring the list of available presentation displays
11c18
< While there are alive Availability objects, the user agent should continuously keep track of the list of available presentation displays and repeat the following steps:
---
> While there are event handlers added to NavigatorPresentation.onavailablechange, the user agent must continuously keep track the list of available presentation displays and repeat the following steps:
15,20c22,25
< If the list of available presentation displays is empty and newDisplays is not empty, then for each alive Availability object:
< Set the object's current property to true.
< Queue a task to fire an event named change at the object.
< If the list of available presentation displays is not empty and newDisplays is empty, then for each alive Availability object:
< Set the object's current property to false.
< Queue a task to fire an event named change at the object.
---
> If the list of available presentation displays is empty and newDisplays is not empty, then
> Queue a task to fire an event named availablechange at NavigatorPresentation with the event's available property set to true.
> If the list of available presentation displays is not empty and newDisplays is empty, then:
> Queue a task to fire an event named availablechange at NavigatorPresentation with the event's available property set to false.
22c27
< The mechanism used to monitor presention displays availability is left to the user agent. The user agent may choose to search for displays at any time, not just when there's an alive Availability object.
---
> The mechanism used to monitor presention displays availability is left to the user agent. The user agent may choose search for displays at any time, not just when event handlers are added to NavigatorPresentation.onavailablechange.
28,30c33
< For each alive Availability object:
< Set the object's current property to false.
< Queue a task to fire an event named change at the object.
\ No newline at end of file
---
> Queue a task to fire an event named availablechange at NavigatorPresentation with the event's available property set to false.
\ No newline at end of file