|
1117 | 1117 | abort these steps.
|
1118 | 1118 | li>
|
1119 | 1119 | <li>If there is already an unsettled <a>Promisea> from a previous
|
1120 |
| - call to <code>startcode> on any <code>PresentationRequestcode> |
1121 |
| - in the same <a>controlling browsing contexta>, return a new |
1122 |
| - <a>Promise</a> rejected with an <a>OperationErrora> exception and |
1123 |
| - abort all remaining steps. |
| 1120 | + call to <a for="PresentationRequest">starta> on any |
| 1121 | + <a>PresentationRequesta> in the same <a>controlling browsing |
| 1122 | + context</a>, return a new <a>Promisea> rejected with an |
| 1123 | + <a>OperationErrora> exception and abort all remaining steps. |
1124 | 1124 | li>
|
1125 | 1125 | <li>Let <var>Pvar> be a new <a>Promisea>.
|
1126 | 1126 | li>
|
|
1542 | 1542 | any <a>available presentation displaya> for at least one of the
|
1543 | 1543 | <a>presentation request URLsa> of the request.
|
1544 | 1544 | p>
|
| 1545 | + <p> |
| 1546 | + The <a>presentation display availabilitya> for a presentation |
| 1547 | + request is eligible for garbage collection when no ECMASCript code |
| 1548 | + can observe the <code>PresentationAvailabilitycode> object. |
| 1549 | + p> |
1545 | 1550 | <p>
|
1546 | 1551 | If the <a>controlling user agenta> can <a>monitor the list of
|
1547 | 1552 | available presentation displaysa> in the background (without a
|
|
1564 | 1569 | <h4>
|
1565 | 1570 | The set of presentation availability objects
|
1566 | 1571 | h4>
|
1567 |
| - <p> |
1568 |
| - Each <code>PresentationRequestcode> has a <a>presentation |
1569 |
| - availability promisea> and a <a>presentation display |
1570 |
| - availabilitya>, which are initially set to <code>nullcode>. The |
1571 |
| - <dfn>presentation availability promisedfn> for a |
1572 |
| - <code>PresentationRequestcode> is a <code>Promisecode> object |
1573 |
| - that <a data-lt="resolve">resolvesa> to the <a>presentation |
1574 |
| - display availabilitya> for the request. |
1575 |
| - p> |
1576 | 1572 | <p>
|
1577 | 1573 | The <a>user agenta> MUST keep track of the <dfn>set of
|
1578 | 1574 | presentation availability objectsdfn> created by the
|
|
1677 | 1673 | li>
|
1678 | 1674 | ol>
|
1679 | 1675 | li>
|
1680 |
| - <li>If the <a>presentation availability promisea> for |
1681 |
| - <code>presentationRequestcode> is not <code>nullcode>, return |
1682 |
| - the <code>presentationRequestcode> object's <a>presentation |
1683 |
| - availability promisea> and abort these steps. |
| 1676 | + <li>If there is an unsettled <a>Promisea> from a previous call to |
| 1677 | + <a for="PresentationRequest">getAvailabilitya> on |
| 1678 | + <code>presentationRequestcode>, return that <a>Promisea> and |
| 1679 | + abort these steps. |
1684 | 1680 | li>
|
1685 |
| - <li>Otherwise, set the <code>presentationRequestcode> object's |
1686 |
| - <a>presentation availability promisea> to a newly created <code> |
1687 |
| - Promisecode> object and set <var>Pvar> to this |
1688 |
| - <code>Promisecode>. |
| 1681 | + <li>Otherwise, let <var>Pvar> be a new <a>Promisea>. |
1689 | 1682 | li>
|
1690 |
| - <li>Return the <code>presentationRequestcode> object's |
1691 |
| - <a>presentation availability promisea>, but continue running |
1692 |
| - these steps <a>in parallela>. |
| 1683 | + <li>Return <var>Pvar>, but continue running these steps <a>in |
| 1684 | + parallela>. |
1693 | 1685 | li>
|
1694 | 1686 | <li>If the user agent is unable to continuously <a>monitor the list
|
1695 | 1687 | of available presentation displaysa> in the background, but can
|
|
1717 | 1709 | li>
|
1718 | 1710 | <li>Set the <a>presentation display availabilitya> for
|
1719 | 1711 | <var>presentationRequestvar> to a newly created
|
1720 |
| - <code>PresentationAvailabilitycode> object, and let <var>Avar> |
1721 |
| - be that object. |
| 1712 | + <a>PresentationAvailabilitya> object, and let <var>Avar> be |
| 1713 | + that object. |
1722 | 1714 | li>
|
1723 |
| - <li>Set the <code>valuecode> property of <var>Avar> as follows: |
1724 |
| - <ol> |
1725 |
| - <li> |
1726 |
| - <code>falsecode> if the <a>list of available presentation |
1727 |
| - displaysa> is empty. |
1728 |
| - li> |
1729 |
| - <li> |
1730 |
| - <code>truecode> if there is at least one <a>available |
1731 |
| - presentation displaya> for some member of |
1732 |
| - <var>presentationUrlsvar>. That is, there is an entry |
1733 |
| - <var>(presentationUrl, display)var> in the <a>list of |
1734 |
| - available presentation displaysa> for some |
1735 |
| - <var>presentationUrlvar> in <var>presentationUrlsvar>. |
1736 |
| - li> |
1737 |
| - <li> |
1738 |
| - <code>falsecode> otherwise. |
1739 |
| - li> |
1740 |
| - ol> |
| 1715 | + <li>Set the <code>valuecode> property of <var>Avar> to |
| 1716 | + <code>falsecode>. |
1741 | 1717 | li>
|
1742 | 1718 | <li>Create a tuple <em>(<var>Avar>,
|
1743 | 1719 | <var>presentationUrlsvar>)em> and add it to the <a>set of
|
1744 | 1720 | presentation availability objectsa>.
|
1745 | 1721 | li>
|
1746 | 1722 | <li>Run the algorithm to <a>monitor the list of available
|
1747 |
| - presentation displaysa> <a>in parallela>. |
| 1723 | + presentation displaysa>. |
| 1724 | + <div class="note"> |
| 1725 | + This algorithm needs to run even if it is already running to |
| 1726 | + pick up the tuple created in the previous step. |
| 1727 | + div> |
1748 | 1728 | li>
|
1749 | 1729 | <li>
|
1750 | 1730 | <a>Resolvea> <var>Pvar> with <var>Avar>.
|
|
1761 | 1741 | "PresentationRequest" data-lt="start">select a presentation
|
1762 | 1742 | displaya>, the <a>user agenta> MUST <dfn>monitor the list of
|
1763 | 1743 | available presentation displaysdfn> by running the following
|
1764 |
| - steps. |
| 1744 | + steps: |
1765 | 1745 | p>
|
1766 | 1746 | <ol link-for="PresentationAvailability">
|
1767 |
| - <li>Set the <a>list of available presentation displaysa> to the |
1768 |
| - empty list. |
| 1747 | + <li>Let <var>availabilitySetvar> be a shallow copy of the <a>set |
| 1748 | + of presentation availability objectsa>. |
| 1749 | + li> |
| 1750 | + <li>If there is a pending request to <a for="PresentationRequest" |
| 1751 | + data-lt="start">select a presentation displaya> for a |
| 1752 | + <a>PresentationRequesta> and if the <a>PresentationRequesta>'s |
| 1753 | + <a>presentation display availabilitya> is <code>nullcode>, then |
| 1754 | + run the following substeps: |
| 1755 | + <ol> |
| 1756 | + <li>Let <var>Avar> be a newly created |
| 1757 | + <a>PresentationAvailabilitya> object. |
| 1758 | + li> |
| 1759 | + <li>Set the <var>valuevar> property of <var>Avar> to <code> |
| 1760 | + falsecode>. |
| 1761 | + li> |
| 1762 | + <li>Create a tuple <em>(<var>Avar>, |
| 1763 | + <var>presentationUrlsvar>)em> where |
| 1764 | + <var>presentationUrlsvar> is the <a>PresentationRequesta>'s |
| 1765 | + <a>presentation request URLsa> and add it to the <a>set of |
| 1766 | + presentation availability objectsa>. |
| 1767 | + li> |
| 1768 | + ol> |
1769 | 1769 | li>
|
1770 | 1770 | <li>Let <var>newDisplaysvar> be an empty list.
|
1771 | 1771 | li>
|
|
1776 | 1776 | <li>Retrieve <a>presentation displaysa> (using an implementation
|
1777 | 1777 | specific mechanism) and set <var>newDisplaysvar> to this list.
|
1778 | 1778 | li>
|
| 1779 | + <li>Set the <a>list of available presentation displaysa> to the |
| 1780 | + empty list. |
| 1781 | + li> |
1779 | 1782 | <li>For each member <em>(<var>Avar>,
|
1780 | 1783 | <var>availabilityUrlsvar>)em> of the <a>set of presentation
|
1781 | 1784 | availability objectsa>, run the following steps:
|
|
1806 | 1809 | ol>
|
1807 | 1810 | li>
|
1808 | 1811 | <li>If <var>previousAvailabilityvar> is not equal to
|
1809 |
| - <var>newAvailabilityvar>, then <a>queue a taska> to run the |
1810 |
| - following steps: |
| 1812 | + <var>newAvailabilityvar>, then run the following steps: |
1811 | 1813 | <ol>
|
1812 |
| - <li>Set <var>Avar>'s <a>valuea> property to |
1813 |
| - <var>newAvailabilityvar>. |
| 1814 | + <li>If <var>Avar> has already been exposed to ECMAScript |
| 1815 | + code, then <a>queue a taska> to run the following steps: |
| 1816 | + <ol> |
| 1817 | + <li>Set <var>Avar>'s <a>valuea> property to |
| 1818 | + <var>newAvailabilityvar>. |
| 1819 | + li> |
| 1820 | + <li> |
| 1821 | + <a>Fire a simple eventa> named <a>changea> at |
| 1822 | + <var>Avar>. |
| 1823 | + li> |
| 1824 | + ol> |
1814 | 1825 | li>
|
1815 |
| - <li> |
1816 |
| - <a>Fire a simple eventa> named <a>changea> at |
1817 |
| - <var>Avar>. |
| 1826 | + <li>Otherwise, set <var>Avar>'s <a>valuea> property to |
| 1827 | + <var>newAvailabilityvar>. |
1818 | 1828 | li>
|
1819 | 1829 | ol>
|
1820 | 1830 | li>
|
1821 | 1831 | ol>
|
1822 | 1832 | li>
|
1823 | 1833 | ol>
|
| 1834 | + <div class="note"> |
| 1835 | + Multiple requests to run the algorithm to <a>monitor the list of |
| 1836 | + available presentation displaysa> may occur at once, e.g., due to |
| 1837 | + calls to <a for="PresentationRequest">getAvailabilitya> and |
| 1838 | + <a for="PresentationRequest">starta>. The <a>user agenta> may |
| 1839 | + run such requests in parallel, serialize them, or interrupt the |
| 1840 | + algorithm if it is before or at step 5 and run it again to group |
| 1841 | + requests. |
| 1842 | + div> |
1824 | 1843 | <p>
|
1825 |
| - When a <a>PresentationAvailabilitya> object is no longer alive |
1826 |
| - (i.e., is eligible for garbage collection), the <a>user agenta> |
1827 |
| - SHOULD run the following steps: |
| 1844 | + When a <a>presentation display availabilitya> object is no longer |
| 1845 | + alive (i.e., is eligible for garbage collection), the <a>user |
| 1846 | + agenta> SHOULD run the following steps: |
1828 | 1847 | p>
|
1829 | 1848 | <ol>
|
| 1849 | + <li>Let <var>Avar> be the newly deceased |
| 1850 | + <a>PresentationAvailabilitya> object |
| 1851 | + li> |
1830 | 1852 | <li>Find and remove any entry <em>(<var>Avar>,
|
1831 | 1853 | <var>availabilityUrlvar>)em> in the <a>set of presentation
|
1832 |
| - availability objectsa> for the newly deceased <var>Avar>. |
| 1854 | + availability objectsa>. |
1833 | 1855 | li>
|
1834 | 1856 | <li>If the <a>set of presentation availability objectsa> is now
|
1835 | 1857 | empty and there is no pending request to <a for=
|
|
0 commit comments