Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1084559 of PresentationConnectionList

  • Revision slug: Web/API/PresentationConnectionList
  • Revision title: PresentationConnectionList
  • Revision id: 1084559
  • Created:
  • Creator: MashKao
  • Is current revision? No
  • Comment

Revision Content

When the receiving user agent is to start monitoring incoming presentation connections in a receiving browsing context from controlling browsing contexts, it MUST listen to and accept incoming connection requests from a controlling browsing context using an implementation specific mechanism. When a new connection request is received from a controlling browsing context, the receiving user agent MUST run the following steps:

Input
I, the presentation identifier passed by the controlling browsing context with the incoming connection request.
presentationId, the presentation identifier used to create the receiving browsing context.
presentationUrl, the presentation request URL used to create the receiving browsing context.
  1. If presentationId and I are not equal, refuse the connection and abort all remaining steps.
  2. Create a new PresentationConnection S.
  3. Set the presentation identifier of S to I.
  4. Set the presentation URL of S to presentationUrl.
  5. Establish the connection between the controlling and receiving browsing contexts using an implementation specific mechanism.
  6. If connection establishment completes successfully, set the presentation connection state of S to connected. Otherwise, set the presentation connection state of S to closed and abort all remaining steps.
  7. Add S to the set of presentation controllers.
  8. If the presentation controllers monitor is null, run the following steps in parallel.
    1. Let the presentation controllers monitor be a new PresentationConnectionList.
    2. Populate the presentation controllers monitor with the set of presentation controllers.
    3. If the presentation controllers promise is not null, resolve the presentation controllers promise with the presentation controllers monitor.
    4. Abort all remaining steps.
  9. Otherwise, run the following steps in parallel.
    1. Populate the presentation controllers monitor with the set of presentation controllers.
    2. Queue a task to fire a trusted event with the name connectionavailable, that uses the PresentationConnectionAvailableEvent interface, with the connection attribute initialized to S, at the presentation controllers monitor. The event must not bubble, must not be cancelable, and has no default action.

Attribute

Event Handlers

The following are the event handlers (and their corresponding event handler event types) that must be supported, as event handler IDL attributes, by objects implementing the PresentationConnectionList interface.

Event handler Event handler event type
onconnectionavailable connectionavailable

Revision Source

<p>When the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-receiving-user-agent">receiving user agent</a> is to start <dfn data-dfn-type="dfn" id="dfn-monitoring-incoming-presentation-connections">monitoring incoming presentation connections</dfn> in a <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-receiving-browsing-context">receiving browsing context</a> from <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-controlling-browsing-context">controlling browsing contexts</a>, it <em class="rfc2119" title="MUST">MUST</em> listen to and accept incoming connection requests from a <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-controlling-browsing-context">controlling browsing context</a> using an implementation specific mechanism. When a new connection request is received from a <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-controlling-browsing-context">controlling browsing context</a>, the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-receiving-user-agent">receiving user agent</a> <em class="rfc2119" title="MUST">MUST</em> run the following steps:</p>

<dl>
 <dt>Input</dt>
 <dd><var>I</var>, the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-identifier">presentation identifier</a> passed by the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-controlling-browsing-context">controlling browsing context</a> with the incoming connection request.</dd>
 <dd><var>presentationId</var>, the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-identifier">presentation identifier</a> used to <a class="internalDFN" data-link-type="dfn" data-lt="create a receiving browsing context" href="https://www.w3.org/TR/presentation-api/#dfn-create-a-receiving-browsing-context">create the receiving browsing context</a>.</dd>
 <dd><var>presentationUrl</var>, the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-request-urls">presentation request URL</a> used to <a class="internalDFN" data-link-type="dfn" data-lt="create a receiving browsing context" href="https://www.w3.org/TR/presentation-api/#dfn-create-a-receiving-browsing-context">create the receiving browsing context</a>.</dd>
</dl>

<ol>
 <li>If <var>presentationId</var> and <var>I</var> are not equal, refuse the connection and abort all remaining steps.</li>
 <li>Create a new <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#idl-def-presentationconnection"><code>PresentationConnection</code></a> <var>S</var>.</li>
 <li>Set the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-identifier">presentation identifier</a> of <var>S</var> to <var> I</var>.</li>
 <li>Set the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-url">presentation URL</a> of <var>S</var> to <var>presentationUrl</var>.</li>
 <li>Establish the connection between the controlling and <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-receiving-browsing-context">receiving browsing contexts</a> using an implementation specific mechanism.</li>
 <li>If connection establishment completes successfully, set the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-connection-state"> presentation connection state</a> of <var>S</var> to <a class="internalDFN" data-for="PresentationConnectionState" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dom-presentationconnectionstate-connected"><code>connected</code></a>. Otherwise, set the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-connection-state">presentation connection state</a> of <var>S</var> to <a class="internalDFN" data-for="PresentationConnectionState" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dom-presentationconnectionstate-closed"><code>closed</code></a> and abort all remaining steps.</li>
 <li>Add <var>S</var> to the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-set-of-presentation-controllers">set of presentation controllers</a>.</li>
 <li>If the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-controllers-monitor">presentation controllers monitor</a> is <code>null</code>, run the following steps <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-in-parallel">in parallel</a>.
  <ol>
   <li>Let the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-controllers-monitor">presentation controllers monitor</a> be a new <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#idl-def-presentationconnectionlist"><code>PresentationConnectionList</code></a>.</li>
   <li>Populate the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-controllers-monitor">presentation controllers monitor</a> with the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-set-of-presentation-controllers">set of presentation controllers</a>.</li>
   <li>If the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-controllers-promise">presentation controllers promise</a> is not <code>null</code>, <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-resolving-a-promise">resolve</a> the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-controllers-promise">presentation controllers promise</a> with the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-controllers-monitor">presentation controllers monitor</a>.</li>
   <li>Abort all remaining steps.</li>
  </ol>
 </li>
 <li>Otherwise, run the following steps <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-in-parallel">in parallel</a>.
  <ol>
   <li>Populate the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-controllers-monitor">presentation controllers monitor</a> with the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-set-of-presentation-controllers">set of presentation controllers</a>.</li>
   <li><a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-queue-a-task">Queue a task</a> to <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-firing-an-event">fire</a> a <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-trusted-event">trusted event</a> with the name <a class="internalDFN" data-for="PresentationConnectionList" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-connectionavailable"><code>connectionavailable</code></a>, that uses the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#idl-def-presentationconnectionavailableevent"><code>PresentationConnectionAvailableEvent</code></a> interface, with the <a class="internalDFN" data-for="PresentationConnectionAvailableEvent" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#idl-def-presentationconnectionavailableevent-connection"><code>connection</code></a> attribute initialized to <var>S</var>, at the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-controllers-monitor">presentation controllers monitor</a>. The event must not bubble, must not be cancelable, and has no default action.</li>
  </ol>
 </li>
</ol>

<h2>Attribute</h2>

<ul>
 <li><dfn data-dfn-for="presentationconnectionlist" data-dfn-type="dfn" data-idl="" id="dom-presentationconnectionlist-connections"><code>connections</code></dfn> attribute <em class="rfc2119" title="MUST">MUST</em> return the non-terminated set of <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-presentation-connection">presentation connections</a> in the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#dfn-set-of-presentation-controllers">set of presentation controllers</a>.</li>
</ul>

<h3>Event Handlers</h3>

<p>The following are the event handlers (and their corresponding event handler event types) that must be supported, as event handler IDL attributes, by objects implementing the <a class="internalDFN" data-link-type="dfn" href="https://www.w3.org/TR/presentation-api/#idl-def-presentationconnectionlist"><code>PresentationConnectionList</code></a> interface.</p>

<table data-dfn-for="presentationconnectionlist">
 <thead>
  <tr>
   <th>Event handler</th>
   <th>Event handler event type</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><dfn data-dfn-for="presentationconnectionlist" data-dfn-type="dfn" data-idl="" id="dom-presentationconnectionlist-onconnectionavailable"><code>onconnectionavailable</code></dfn></td>
   <td><code>connectionavailable</code></td>
  </tr>
 </tbody>
</table>
Revert to this revision