|
1126 | 1126 | abort these steps.
|
1127 | 1127 | li>
|
1128 | 1128 | <li>If there is already an unsettled <a>Promisea> from a previous
|
1129 |
| - call to <code>startcode> on any <code>PresentationRequestcode> |
1130 |
| - in the same <a>controlling browsing contexta>, return a new |
1131 |
| - <a>Promise</a> rejected with an <a>OperationErrora> exception and |
1132 |
| - abort all remaining steps. |
| 1129 | + call to <a for="PresentationRequest">starta> on any |
| 1130 | + <a>PresentationRequesta> in the same <a>controlling browsing |
| 1131 | + context</a>, return a new <a>Promisea> rejected with an |
| 1132 | + <a>OperationErrora> exception and abort all remaining steps. |
1133 | 1133 | li>
|
1134 | 1134 | <li>Let <var>Pvar> be a new <a>Promisea>.
|
1135 | 1135 | li>
|
|
1551 | 1551 | any <a>available presentation displaya> for at least one of the
|
1552 | 1552 | <a>presentation request URLsa> of the request.
|
1553 | 1553 | p>
|
| 1554 | + <p> |
| 1555 | + The <a>presentation display availabilitya> for a presentation |
| 1556 | + request is eligible for garbage collection when no ECMASCript code |
| 1557 | + can observe the <code>PresentationAvailabilitycode> object. |
| 1558 | + p> |
1554 | 1559 | <p>
|
1555 | 1560 | If the <a>controlling user agenta> can <a>monitor the list of
|
1556 | 1561 | available presentation displaysa> in the background (without a
|
|
1561 | 1566 | p>
|
1562 | 1567 | <p>
|
1563 | 1568 | The <dfn for="PresentationAvailability">valuedfn> attribute MUST
|
1564 |
| - return the last value it was set to. The value is updated by the |
1565 |
| - <a>monitor the list of available presentation displaysa> algorithm. |
| 1569 | + return the last value it was set to. The value is initialized and |
| 1570 | + updated by the <a>monitor the list of available presentation |
| 1571 | + displaysa> algorithm. |
1566 | 1572 | p>
|
1567 | 1573 | <p>
|
1568 | 1574 | The <dfn for="PresentationAvailability">onchangedfn> attribute is
|
|
1573 | 1579 | <h4>
|
1574 | 1580 | The set of presentation availability objects
|
1575 | 1581 | h4>
|
1576 |
| - <p> |
1577 |
| - Each <code>PresentationRequestcode> has a <a>presentation |
1578 |
| - availability promisea> and a <a>presentation display |
1579 |
| - availabilitya>, which are initially set to <code>nullcode>. The |
1580 |
| - <dfn>presentation availability promisedfn> for a |
1581 |
| - <code>PresentationRequestcode> is a <code>Promisecode> object |
1582 |
| - that <a data-lt="resolve">resolvesa> to the <a>presentation |
1583 |
| - display availabilitya> for the request. |
1584 |
| - p> |
1585 | 1582 | <p>
|
1586 | 1583 | The <a>user agenta> MUST keep track of the <dfn>set of
|
1587 | 1584 | presentation availability objectsdfn> created by the
|
|
1686 | 1683 | li>
|
1687 | 1684 | ol>
|
1688 | 1685 | li>
|
1689 |
| - <li>If the <a>presentation availability promisea> for |
1690 |
| - <code>presentationRequestcode> is not <code>nullcode>, return |
1691 |
| - the <code>presentationRequestcode> object's <a>presentation |
1692 |
| - availability promisea> and abort these steps. |
| 1686 | + <li>If there is an unsettled <a>Promisea> from a previous call to |
| 1687 | + <a for="PresentationRequest">getAvailabilitya> on |
| 1688 | + <code>presentationRequestcode>, return that <a>Promisea> and |
| 1689 | + abort these steps. |
1693 | 1690 | li>
|
1694 |
| - <li>Otherwise, set the <code>presentationRequestcode> object's |
1695 |
| - <a>presentation availability promisea> to a newly created <code> |
1696 |
| - Promisecode> object and set <var>Pvar> to this |
1697 |
| - <code>Promisecode>. |
| 1691 | + <li>Otherwise, let <var>Pvar> be a new <a>Promisea>. |
1698 | 1692 | li>
|
1699 |
| - <li>Return the <code>presentationRequestcode> object's |
1700 |
| - <a>presentation availability promisea>, but continue running |
1701 |
| - these steps <a>in parallela>. |
| 1693 | + <li>Return <var>Pvar>, but continue running these steps <a>in |
| 1694 | + parallela>. |
1702 | 1695 | li>
|
1703 | 1696 | <li>If the user agent is unable to continuously <a>monitor the list
|
1704 | 1697 | of available presentation displaysa> in the background, but can
|
|
1726 | 1719 | li>
|
1727 | 1720 | <li>Set the <a>presentation display availabilitya> for
|
1728 | 1721 | <var>presentationRequestvar> to a newly created
|
1729 |
| - <code>PresentationAvailabilitycode> object, and let <var>Avar> |
1730 |
| - be that object. |
1731 |
| - li> |
1732 |
| - <li>Set the <code>valuecode> property of <var>Avar> as follows: |
1733 |
| - <ol> |
1734 |
| - <li> |
1735 |
| - <code>falsecode> if the <a>list of available presentation |
1736 |
| - displaysa> is empty. |
1737 |
| - li> |
1738 |
| - <li> |
1739 |
| - <code>truecode> if there is at least one <a>available |
1740 |
| - presentation displaya> for some member of |
1741 |
| - <var>presentationUrlsvar>. That is, there is an entry |
1742 |
| - <var>(presentationUrl, display)var> in the <a>list of |
1743 |
| - available presentation displaysa> for some |
1744 |
| - <var>presentationUrlvar> in <var>presentationUrlsvar>. |
1745 |
| - li> |
1746 |
| - <li> |
1747 |
| - <code>falsecode> otherwise. |
1748 |
| - li> |
1749 |
| - ol> |
| 1722 | + <a>PresentationAvailabilitya> object, and let <var>Avar> be |
| 1723 | + that object. |
1750 | 1724 | li>
|
1751 | 1725 | <li>Create a tuple <em>(<var>Avar>,
|
1752 | 1726 | <var>presentationUrlsvar>)em> and add it to the <a>set of
|
1753 | 1727 | presentation availability objectsa>.
|
1754 | 1728 | li>
|
1755 | 1729 | <li>Run the algorithm to <a>monitor the list of available
|
1756 |
| - presentation displaysa> <a>in parallela>. |
| 1730 | + presentation displaysa>. |
| 1731 | + <div class="note"> |
| 1732 | + The monitoring algorithm must be run at least one more time |
| 1733 | + after the previous step to pick up the tuple that was added to |
| 1734 | + the <a>set of presentation availability objectsa>. |
| 1735 | + div> |
1757 | 1736 | li>
|
1758 | 1737 | <li>
|
1759 | 1738 | <a>Resolvea> <var>Pvar> with <var>Avar>.
|
|
1770 | 1749 | "PresentationRequest" data-lt="start">select a presentation
|
1771 | 1750 | displaya>, the <a>user agenta> MUST <dfn>monitor the list of
|
1772 | 1751 | available presentation displaysdfn> by running the following
|
1773 |
| - steps. |
| 1752 | + steps: |
1774 | 1753 | p>
|
1775 | 1754 | <ol link-for="PresentationAvailability">
|
1776 |
| - <li>Set the <a>list of available presentation displaysa> to the |
1777 |
| - empty list. |
| 1755 | + <li>Let <var>availabilitySetvar> be a shallow copy of the <a>set |
| 1756 | + of presentation availability objectsa>. |
| 1757 | + li> |
| 1758 | + <li>If there is a pending request to <a for="PresentationRequest" |
| 1759 | + data-lt="start">select a presentation displaya> for a |
| 1760 | + <a>PresentationRequesta> and if the <a>PresentationRequesta>'s |
| 1761 | + <a>presentation display availabilitya> is <code>nullcode>, then |
| 1762 | + run the following substeps: |
| 1763 | + <ol> |
| 1764 | + <li>Let <var>Avar> be a newly created |
| 1765 | + <a>PresentationAvailabilitya> object. |
| 1766 | + li> |
| 1767 | + <li>Create a tuple <em>(<var>Avar>, |
| 1768 | + <var>presentationUrlsvar>)em> where |
| 1769 | + <var>presentationUrlsvar> is the <a>PresentationRequesta>'s |
| 1770 | + <a>presentation request URLsa> and add it to |
| 1771 | + <var>availabilitySetvar>. |
| 1772 | + li> |
| 1773 | + ol> |
1778 | 1774 | li>
|
1779 | 1775 | <li>Let <var>newDisplaysvar> be an empty list.
|
1780 | 1776 | li>
|
|
1785 | 1781 | <li>Retrieve <a>presentation displaysa> (using an implementation
|
1786 | 1782 | specific mechanism) and set <var>newDisplaysvar> to this list.
|
1787 | 1783 | li>
|
| 1784 | + <li>Set the <a>list of available presentation displaysa> to the |
| 1785 | + empty list. |
| 1786 | + li> |
1788 | 1787 | <li>For each member <em>(<var>Avar>,
|
1789 |
| - <var>availabilityUrlsvar>)em> of the <a>set of presentation |
1790 |
| - availability objectsa>, run the following steps: |
| 1788 | + <var>availabilityUrlsvar>)em> of <var>availabilitySetvar>, |
| 1789 | + run the following steps: |
1791 | 1790 | <ol>
|
1792 | 1791 | <li>Set <var>previousAvailabilityvar> to the value of
|
1793 | 1792 | <var>Avar>'s <a>valuea> property.
|
|
1814 | 1813 | li>
|
1815 | 1814 | ol>
|
1816 | 1815 | li>
|
| 1816 | + <li>If <var>Avar>'s <a>valuea> property has not yet been |
| 1817 | + initialized, then set <var>Avar>'s <a>valuea> property to |
| 1818 | + <var>newAvailabilityvar> and skip the following step. |
| 1819 | + li> |
1817 | 1820 | <li>If <var>previousAvailabilityvar> is not equal to
|
1818 | 1821 | <var>newAvailabilityvar>, then <a>queue a taska> to run the
|
1819 | 1822 | following steps:
|
|
1830 | 1833 | ol>
|
1831 | 1834 | li>
|
1832 | 1835 | ol>
|
| 1836 | + <div class="note"> |
| 1837 | + The <a>controlling user agenta> may choose how often to |
| 1838 | + <a>monitor the list of available presentation displaysa>, |
| 1839 | + including grouping requests from <a for= |
| 1840 | + "PresentationRequest">starta> and <a for= |
| 1841 | + "PresentationRequest">getAvailabilitya>, and aggregating them |
| 1842 | + across <a data-lt="browsing context">browsing contextsa>. |
| 1843 | + div> |
1833 | 1844 | <p>
|
1834 |
| - When a <a>PresentationAvailabilitya> object is no longer alive |
1835 |
| - (i.e., is eligible for garbage collection), the <a>user agenta> |
1836 |
| - SHOULD run the following steps: |
| 1845 | + When a <a>presentation display availabilitya> object is eligible |
| 1846 | + for garbage collection, the <a>user agenta> SHOULD run the |
| 1847 | + following steps: |
1837 | 1848 | p>
|
1838 | 1849 | <ol>
|
| 1850 | + <li>Let <var>Avar> be the newly deceased |
| 1851 | + <a>PresentationAvailabilitya> object |
| 1852 | + li> |
1839 | 1853 | <li>Find and remove any entry <em>(<var>Avar>,
|
1840 | 1854 | <var>availabilityUrlvar>)em> in the <a>set of presentation
|
1841 |
| - availability objectsa> for the newly deceased <var>Avar>. |
| 1855 | + availability objectsa>. |
1842 | 1856 | li>
|
1843 | 1857 | <li>If the <a>set of presentation availability objectsa> is now
|
1844 | 1858 | empty and there is no pending request to <a for=
|
|
0 commit comments