diff --git a/index.html b/index.html index 33bd6f3..5cbde44 100644 --- a/index.html +++ b/index.html @@ -76,17 +76,8 @@ ], sotdAfterWGinfo: true, group: 'secondscreen', - xref: ['html', 'webidl'], + xref: ['dom', 'fileapi', 'mixed-content', 'html', 'url', 'webidl', 'webrtc'], localBiblio: { - PROMGUIDE: { - title: 'Writing Promise-Using Specifications', - href: 'http://www.w3.org/2001/tag/doc/promises-guide', - authors: [ - 'Domenic Denicola' - ], - status: 'finding', - publisher: 'W3C' - }, DIAL: { title: 'DIscovery And Launch Protocol Specification', href: 'http://www.dial-multiscreen.org/dial-protocol-specification', @@ -317,334 +308,96 @@

Terminology

- The following terms are defined in [[!HTML]]: -

- -

- The term JavaScript - realm is defined in [[!ECMASCRIPT]]. + The term JavaScript realm is used as defined in ECMAScript + [[!ECMASCRIPT]].

- The terms and concepts EventTarget, - Event, - EventInit, - firing an - event, and trusted - event are defined in [[!DOM]]. + The term current realm is used as defined in ECMAScript [[!ECMASCRIPT]].

- The term MessageEvent - is defined in [[!WEBMESSAGING]]. + The terms resolved and rejected in the context of {{Promise}} objects + are used as defined in [[!ECMASCRIPT]].

- This document provides interface definitions using the Web IDL standard - [[!WEBIDL-2]]. + The header Accept-Language is used as defined in HTTP/1.1 [[!rfc7231]].

- The terms throw, - Promise, - ArrayBuffer, - ArrayBufferView, - and the following exception names are defined in [[!WEBIDL-2]]: + HTTP authentication is used as defined in HTTP/1.1: + Authentication [[!rfc7235]].

-

- The terms resolving - a Promise and rejecting - a Promise are used as explained in [[!PROMGUIDE]]. + The term cookie store is used as defined in RFC 6265 [[!COOKIES]].

- The term URL - is defined in the WHATWG URL standard [[!URL]]. + The term UUID is used as defined in RFC 4122 [[!rfc4122]].

- The term Blob - is defined in the File API specification [[!FILEAPI]]. + The term DIAL is used as defined in DIAL [[DIAL]].

- The header Accept-Language - is defined in HTTP/1.1 [[!rfc7231]]. + The term trusted event refers to an {{Event}} whose + {{Event/isTrusted}} attribute is true in [[!DOM]].

- HTTP - authentication is defined in HTTP/1.1: Authentication - [[!rfc7235]]. + The term reload a document refers to steps run when the + {{Location/reload()}} method gets called in [[!HTML]].

- The term RTCDataChannel - is defined in the WebRTC API specification [[WEBRTC]]. + The term local storage area refers to the storage areas + exposed by the {{WindowLocalStorage/localStorage}} attribute, and the + term session storage area refers to the storage areas exposed + by the {{WindowSessionStorage/sessionStorage}} attribute in [[!HTML]].

- The term cookie store - is defined in RFC 6265 [[!COOKIES]]. -

-

- The term UUID is defined in RFC - 4122 [[!rfc4122]]. -

-

- The terms permission - descriptor type and permission - state are defined in [[!PERMISSIONS]]. -

-

- The term database - is defined in [[!INDEXEDDB]]. -

-

- The terms local - storage areas and session - storage areas are defined in [[!WEBSTORAGE]]. -

-

- The term - a priori authenticated URL is defined in [[!MIXED-CONTENT]]. -

-

- The terms service - worker, - - a list of registered service worker registrations, - caches, - window - client and worker - client are defined in [[!SERVICE-WORKERS]]. -

-

- The term DIAL - is defined in [[DIAL]]. + This specification references terms exported by other specifications, + see . It also references the + following internal concepts from other specifications:

+

@@ -1042,10 +795,10 @@

"PresentationRequest">reconnect, or received a presentation connection via a connectionavailable event. In algorithms - for PresentationRequest, the controlling - browsing context is the responsible browsing context whose + for PresentationRequest, the controlling + browsing context is the browsing context whose JavaScript realm was used to construct the - PresentationRequest. + PresentationRequest.

The null, provides the presentation controllers monitor once the initial presentation connection is established. The presentation controllers promise is - represented by a Promise that resolves with the + represented by a {{Promise}} that resolves with the presentation controllers monitor.

@@ -1120,7 +873,7 @@

objects constructed by algorithm steps is the current realm.

-
+

Interface Presentation

@@ -1135,10 +888,9 @@

- The presentation - attribute is used to retrieve an instance of the Presentation interface. It MUST return the - Presentation instance. + The presentation + attribute is used to retrieve an instance of the Presentation + interface. It MUST return the Presentation instance.

@@ -1200,7 +952,7 @@

The receiver - attribute MUST return the PresentationReceiver + attribute MUST return the PresentationReceiver instance associated with the receiving browsing context and created by the receiving user agent when the receiving browsing context is };

- A PresentationRequest object is associated with a + A PresentationRequest object is associated with a request to initiate or reconnect to a presentation made by a controlling browsing context. The - PresentationRequest object MUST be implemented in + PresentationRequest object MUST be implemented in a controlling browsing context provided by a controlling user agent.

- When a PresentationRequest is constructed, the + When a PresentationRequest is constructed, the given urls MUST be used as the list of presentation request URLs which are each a possible presentation URL for the - PresentationRequest instance. + PresentationRequest instance.

@@ -1272,12 +1024,12 @@

    -
  1. If the document object's active sandboxing flag set has +
  2. If the document object's [=Document/active sandboxing flag set=] has the sandboxed presentation browsing context flag set, then - throw a SecurityError and abort these steps. + throw a {{SecurityError}} and abort these steps.
  3. -
  4. If urls is an empty sequence, then throw a - NotSupportedError and abort all remaining steps. +
  5. If urls is an empty sequence, then [=exception/throw=] a + {{NotSupportedError}} and abort all remaining steps.
  6. If a single url was provided, let urls be a one item array containing url. @@ -1291,7 +1043,7 @@

    the current settings object.

  7. If the parse a URL algorithm failed, then - throw a SyntaxError exception and abort all + [=exception/throw=] a {{SyntaxError}} exception and abort all remaining steps.
  8. If A's scheme is supported by the controlling @@ -1301,10 +1053,10 @@

  • If presentationUrls is an empty list, then throw a - NotSupportedError and abort all remaining steps. + {{NotSupportedError}} and abort all remaining steps.
  • If any member of presentationUrls is not an a - priori authenticated URL, then throw a SecurityError and + priori authenticated URL, then throw a {{SecurityError}} and abort these steps.
  • Construct a new PresentationRequest object with @@ -1336,25 +1088,25 @@

    Output
    - A Promise + A {{Promise}}
      -
    1. If the algorithm isn't allowed to show a popup, return a - Promise rejected with an InvalidAccessError exception - and abort these steps. +
    2. If the document's [=browsing context/active window=] does not + have [=transient activation=], return a {{Promise}} rejected with an + {{InvalidAccessError}} exception and abort these steps.
    3. Let topContext be the top-level browsing context of the controlling browsing context.
    4. -
    5. If there is already an unsettled Promise from a previous +
    6. If there is already an unsettled {{Promise}} from a previous call to start in topContext or any browsing context in the list of descendant browsing contexts of topContext, - return a new Promise rejected with an OperationError + return a new {{Promise}} rejected with an {{OperationError}} exception and abort all remaining steps.
    7. -
    8. Let P be a new Promise. +
    9. Let P be a new {{Promise}}.
    10. Return P, but continue running these steps in parallel. @@ -1384,7 +1136,7 @@

    Then run the following steps:
    1. - Reject P with a NotFoundError + Reject P with a {{NotFoundError}} exception.
    2. Abort all remaining steps. @@ -1392,7 +1144,7 @@

  • If the user denies permission to use a display, reject - P with an NotAllowedError exception, and abort + P with an {{NotAllowedError}} exception, and abort all remaining steps.
  • Otherwise, the user grants permission to use a @@ -1496,7 +1248,7 @@

    D, the selected presentation display
    - P, an optional Promise that will be resolved + P, an optional {{Promise}} that will be resolved with a new presentation connection
    @@ -1530,8 +1282,8 @@

    S.

  • - Queue a task to fire a trusted event with - the name Queue a task to [=fire an event|fire=] a trusted + event with the name connectionavailable, that uses the PresentationConnectionAvailableEvent interface, with the Output
    - P, a Promise + P, a {{Promise}}
      -
    1. Let P be a new Promise. +
    2. Let P be a new {{Promise}}.
    3. Return P, but continue running these steps in parallel. @@ -1689,8 +1441,8 @@

      Resolve P with newConnection.

    4. - Queue a task to fire a trusted event - with the name Queue a task to [=fire an event|fire=] a trusted + event with the name connectionavailable, that uses the PresentationConnectionAvailableEvent interface, with the
  • - Reject P with a NotFoundError exception. + Reject P with a {{NotFoundError}} exception.
  • @@ -1760,7 +1512,7 @@

    - A PresentationAvailability object exposes the + A PresentationAvailability object exposes the presentation display availability for a presentation request. The presentation display availability for a PresentationRequest stores whether there is currently any @@ -1776,7 +1528,7 @@

    If the controlling user agent can monitor the list of available presentation displays in the background (without a pending request to start), - the PresentationAvailability object MUST be + the PresentationAvailability object MUST be implemented in a controlling browsing context.

    @@ -1840,7 +1592,7 @@

    when there are available displays. However, the user agent may not support continuous availability monitoring in the background; for example, because of platform or power consumption - restrictions. In this case the Promise returned by + restrictions. In this case the {{Promise}} returned by getAvailability is rejected, and the algorithm to monitor the list of available presentation displays will only run as @@ -1881,16 +1633,16 @@

    Output
    - A Promise + A {{Promise}}
      -
    1. If there is an unsettled Promise from a previous call to +
    2. If there is an unsettled {{Promise}} from a previous call to getAvailability on - presentationRequest, return that Promise and abort + presentationRequest, return that {{Promise}} and abort these steps.
    3. -
    4. Otherwise, let P be a new Promise constructed +
    5. Otherwise, let P be a new {{Promise}} constructed in the JavaScript realm of presentationRequest.
    6. Return P, but continue running these steps in @@ -1902,7 +1654,7 @@

      then:
      1. - Reject P with a NotSupportedError + Reject P with a {{NotSupportedError}} exception.
      2. Abort all the remaining steps. @@ -2030,8 +1782,8 @@

        newAvailability.

      3. - Fire an event named change whose - isTrusted attribute is true at A. + [=Fire an event=] named change whose + {{Event/isTrusted}} attribute is true at A.

    7. @@ -2090,15 +1842,15 @@

      };

      - A controlling user agent fires a trusted event - named controlling user agent [=fire an event|fires=] a trusted + event named connectionavailable on a PresentationRequest when a connection associated with the object is created. It is fired at the PresentationRequest instance, using the PresentationConnectionAvailableEvent interface, with the connection attribute set - to the PresentationConnection object that was + to the PresentationConnection object that was created. The event is fired for each connection that is created for the controller, either by the controller calling start or @@ -2108,15 +1860,15 @@

      "Presentation">defaultRequest.

      - A receiving user agent fires a trusted event - named receiving user agent [=fire an event|fires=] a trusted + event named connectionavailable on a PresentationReceiver when an incoming connection is created. It is fired at the presentation controllers monitor, using the PresentationConnectionAvailableEvent interface, with the connection attribute set - to the PresentationConnection object that was + to the PresentationConnection object that was created. The event is fired for all connections that are created when monitoring incoming presentation connections.

      @@ -2238,7 +1990,7 @@

      The binaryType attribute can take one of the values of - BinaryType. When a PresentationConnection object is + {{BinaryType}}. When a PresentationConnection object is created, its binaryType attribute MUST be set to the string "arraybuffer". On getting, it MUST return @@ -2249,8 +2001,8 @@

      The binaryType attribute allows authors to control how binary data is exposed to scripts. By setting the attribute to "blob", binary - data is returned in Blob form; by setting it to - "arraybuffer", it is returned in ArrayBuffer + data is returned in {{Blob}} form; by setting it to + "arraybuffer", it is returned in {{ArrayBuffer}} form. The attribute defaults to "arraybuffer". This attribute has no effect on data sent in a string form. @@ -2320,9 +2072,9 @@

      "PresentationConnectionState">connected.
    8. - Fire an event named connect whose - isTrusted attribute is true at + {{Event/isTrusted}} attribute is true at presentationConnection.
    @@ -2355,7 +2107,7 @@

    "PresentationConnection">send it has to be ensured that messages are delivered to the other end reliably and in sequence. The transport should function equivalently to an - RTCDataChannel in reliable mode. + {{RTCDataChannel}} in reliable mode.

    Let presentation message data be the payload data to be @@ -2384,8 +2136,8 @@

    1. If the state property of presentationConnection is not connected, throw an - InvalidStateError exception. + "PresentationConnectionState">connected, [=exception/throw=] an + {{InvalidStateError}} exception.
    2. If the closing procedure of presentationConnection has started, then abort these @@ -2393,7 +2145,7 @@

    3. Let presentation message type messageType be binary if messageOrData is of type - ArrayBuffer, ArrayBufferView, or Blob. Let + {{ArrayBuffer}}, {{ArrayBufferView}}, or {{Blob}}. Let messageType be text if messageOrData is of type DOMString.
    4. @@ -2428,7 +2180,7 @@

    5. Unable to send binary message (invalid_message) - for ArrayBuffer, ArrayBufferView and Blob + for {{ArrayBuffer}}, {{ArrayBufferView}} and {{Blob}} messages.
    6. @@ -2476,7 +2228,7 @@

      "PresentationConnectionState">connected, abort these steps.
    7. Let event be a newly created trusted event - that uses the MessageEvent interface, with the event type + that uses the {{MessageEvent}} interface, with the event type message, which does not bubble, is not cancelable, and has no default action.
    8. @@ -2489,19 +2241,19 @@

    9. If messageType is binary, and binaryType attribute is set to "blob", then initialize event's data attribute to a - new Blob object with messageData as its raw + new {{Blob}} object with messageData as its raw data.
    10. If messageType is binary, and binaryType attribute is set to "arraybuffer", then initialize event's - data attribute to a new ArrayBuffer object + data attribute to a new {{ArrayBuffer}} object whose contents are messageData.
  • - Queue a task to fire event at + Queue a task to [=fire an event|fire=] event at presentationConnection.
  • @@ -2695,7 +2447,7 @@

  • - Fire a trusted event with the name + [=fire an event|Fire=] a trusted event with the name close, that uses the PresentationConnectionCloseEvent interface, with the "PresentationConnectionState">terminated.
  • - Fires an event named terminate whose - isTrusted attribute is true at known + [=Fire an event=] named terminate whose + {{Event/isTrusted}} attribute is true at known connection.
  • @@ -2859,8 +2611,8 @@

    "PresentationConnectionState">terminated.
  • - Fire an event named terminate whose - isTrusted attribute is true at connection. + [=Fire an event=] named terminate whose + {{Event/isTrusted}} attribute is true at connection.
  • @@ -2955,7 +2707,7 @@

    and abort all remaining steps.
  • Otherwise, let the presentation controllers promise be a - new Promise constructed in the JavaScript realm of this + new {{Promise}} constructed in the JavaScript realm of this PresentationReceiver object.
  • Return the presentation controllers promise. @@ -3011,18 +2763,17 @@

  • Create a new empty application cache storage for C.
  • +
  • Create a new empty storage for session storage areas and + local storage areas for C. +
  • If the receiving user agent implements [[!INDEXEDDB]], create a new empty storage for IndexedDB databases for C.
  • -
  • If the receiving user agent implements [[!WEBSTORAGE]], - create a new empty storage for session storage areas and - local storage areas for C. -
  • If the receiving user agent implements - [[!SERVICE-WORKERS]], create a new empty list of registered - service worker registrations and a new empty caches for - C. + [[!SERVICE-WORKERS]], create a new empty list of registered + service worker registrations and a new empty set of {{Cache}} + objects for C.
  • Navigate C to presentationUrl. @@ -3046,7 +2797,7 @@

    When the top-level browsing context attempts to navigate to - a new resource and runs the steps to navigate, it MUST + a new resource and runs the [=navigate|steps to navigate=], it MUST follow step 1 to determine if it is allowed to navigate. In addition, it MUST NOT be allowed to navigate itself to a new resource, except by navigating to a fragment identifier or @@ -3062,10 +2813,11 @@

    If the top-level-browsing context was not allowed to navigate, it SHOULD NOT offer to open the resource in a new top-level browsing context, but otherwise SHOULD be - consistent with the steps to navigate. + consistent with the [=navigate|steps to navigate=].

    - Window clients and worker clients associated with the + [=service worker client/window client|Window clients=] and [=service + worker client/worker client|worker clients=] associated with the receiving browsing context and its list of descendant browsing contexts must not be exposed to service workers associated with each other. @@ -3080,9 +2832,9 @@

    including session history, the cookie store, any HTTP authentication state, the application cache, any databases, the session storage areas, the local - storage areas, the list of registered service worker - registrations and the caches MUST be discarded and not - used for any other browsing context. + storage areas, the list of registered service worker + registrations and the {{Cache}} objects MUST be discarded and + not used for any other browsing context.

    This algorithm is intended to create a well defined environment to @@ -3216,8 +2968,8 @@

    the set of presentation controllers.

  • - Queue a task to fire a trusted event - with the name Queue a task to [=fire an event|fire=] a trusted + event with the name connectionavailable, that uses the PresentationConnectionAvailableEvent interface, with the

  • +
    +

    Acknowledgments