From b675671c575d3be60b3d3e4a3e49e87557b7501b Mon Sep 17 00:00:00 2001 From: "mark a. foltz" Date: Mon, 13 Jun 2016 14:23:18 -0700 Subject: [PATCH 1/7] Start draft --- index.html | 83 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/index.html b/index.html index fc4ea23..29102ab 100644 --- a/index.html +++ b/index.html @@ -511,14 +511,15 @@

// The Present button is visible if at least one presentation display is available var presentBtn = document.getElementById("presentBtn"); // It is also possible to use relative presentation URL e.g. "presentation.html" - var presUrl = "http://example.com/presentation.html"; + var presUrls = ["http://example.com/presentation.html", + "http://another.com/alternate.html"]; // show or hide present button depending on display availability var handleAvailabilityChange = function(available) { presentBtn.style.display = available ? "inline" : "none"; }; // Promise is resolved as soon as the presentation display availability is // known. - var request = new PresentationRequest(presUrl); + var request = new PresentationRequest(presUrls); request.getAvailability().then(function(availability) { // availability.value may be kept up-to-date by the controlling UA as long // as the availability object is alive. It is advised for the web developers @@ -591,7 +592,7 @@

PresentationRequest to use when the controlling UA initiates a presentation. --> <script> - navigator.presentation.defaultRequest = new PresentationRequest(defaultUrl); + navigator.presentation.defaultRequest = new PresentationRequest(presUrls); navigator.presentation.defaultRequest.onconnectionavailable = function(evt) { setConnection(evt.connection); }; @@ -662,7 +663,7 @@

Monitor available connection(s) and say hello

-<!-- receiver.html -->
+<!-- presentation.html -->
 <script>
   var addConnection = function(connection) {
     connection.onconnect = function () {
@@ -697,7 +698,7 @@ 

connection.send("{string: 'Hello, world!', lang: 'en-US'}"); </script> -<!-- receiver.html --> +<!-- presentation.html --> <script> connection.onmessage = function (message) { var messageObj = JSON.parse(message); @@ -917,7 +918,7 @@

Interface PresentationRequest

-          [Constructor(DOMString url)]
+          [Constructor(DOMString[] urls)]
           interface PresentationRequest : EventTarget {
             Promise<PresentationConnection> start();
             Promise<PresentationConnection> reconnect(DOMString presentationId);
@@ -938,8 +939,10 @@ 

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

@@ -955,7 +958,7 @@

Input
- url, the presentation request URL + urls, the list of presentation request URLs
Output @@ -965,15 +968,22 @@

    -
  1. Resolve url relative to the API base URL specified - by the entry settings object, and let - presentationUrl be the resulting absolute URL, if any. -
  2. -
  3. If the resolve a URL algorithm failed, then throw a - SyntaxError exception and abort the remaining steps. +
  4. Let presentationUrls be an empty list of URLs.
  5. +
  6. For each URL url in urls: +
      +
    1. Resolve url relative to the API base URL + specified by the entry settings object, and add the + resulting absolute URL (if any) to + presentationUrls. +
    2. +
    3. + If the resolve a URL algorithm failed, then throw a + SyntaxError exception and abort all remaining steps. +
    4. +
  7. Construct a new PresentationRequest object with - presentationUrl as the constructor argument and return + presentationUrls as the constructor argument and return it.
@@ -996,7 +1006,7 @@

PresentationRequest object
- presentationUrl, the presentation request URL + presentationUrls, the presentation request URLs
Output @@ -1049,8 +1059,8 @@

completed.
  • No member in the list of available presentation - displays is a compatible presentation display for - presentationUrl. + displays is a compatible presentation display for any + member of presentationUrls.
  • Then run the following steps:
      @@ -1082,8 +1092,9 @@

    1. Set the presentation identifier of S to I.
    2. -
    3. Set the presentation URL of S to - presentationUrl. +
    4. Set the presentation URL of S to the + presentationUrl for D in the list of + available presentation displays.
    5. Set the presentation connection state of S to connecting. @@ -1189,8 +1200,8 @@

      its controlling browsing context is the current browsing context, its presentation connection state is not terminated, its - presentation URL is equal to the presentation request - URL of presentationRequest, and its + presentation URL is equal to one of the presentation request + URLs of presentationRequest, and its presentation identifier is equal to presentationId.

    6. @@ -1222,12 +1233,12 @@

      PresentationConnection that meets the following criteria: its presentation connection state is not terminated, its presentation - URL is equal to the presentation request URL of + URL is equal to one of the presentation request URLs of presentationRequest, and its presentation identifier is equal to presentationId. -
    7. If such a PresentationConnection exists, run the - following steps: +
    8. If such a PresentationConnection exists, let E + be that PresentationConnection, and run the following steps:
      1. Create a new PresentationConnection S.
      2. @@ -1235,8 +1246,7 @@

        presentationId.
      3. Set the presentation URL of S to the - presentation request URL of - presentationRequest. + presentation request URL of E.
      4. Set the presentation connection state of S to availability objects requested through the getAvailability() method. The set of availability objects is represented as a set of - tuples (A, availabilityUrl), + tuples (A, availabilityUrl[]), initially empty, where:

          @@ -1355,10 +1365,10 @@

          A is a live PresentationAvailability object;
        1. - availabilityUrl is the presentation request URL + availabilityUrl[] is the list of presentation request URLs when getAvailability() is called to - create A. + create A;

    @@ -1427,7 +1437,7 @@

    Input
    - presentationUrl, the presentation request URL + presentationUrls, a list of presentation request URLs
    Output @@ -1489,7 +1499,7 @@

  • If there exists a tuple (A, - presentationUrl) in the set of availability + presentationUrls) in the set of availability objects, then:
    1. @@ -1506,7 +1516,7 @@

      presentation display, true otherwise.

    2. Create a tuple (A, - presentationUrl) and add it to the set of + presentationUrls) and add it to the set of availability objects.
    3. Run the algorithm to monitor the list of available @@ -1534,7 +1544,7 @@

      be this list.

    4. For each member (A, - availabilityUrl) of the set of availability + availabilityUrls) of the set of availability objects:
      1. Set previousAvailability to the value of @@ -1543,7 +1553,8 @@

      2. Let newAvailability be true if newDisplays is not empty and at least one display in newDisplays is a compatible presentation - display for availabilityUrl. Otherwise, set + display for at least one member + of availabilityUrls. Otherwise, set newAvailability to false.
      3. If previousAvailability is not equal to From 1d053588e1d5e1ceb069bd2f2c8b12d46b8a4ffd Mon Sep 17 00:00:00 2001 From: "mark a. foltz" Date: Mon, 13 Jun 2016 14:23:36 -0700 Subject: [PATCH 2/7] tidy --- index.html | 91 +++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/index.html b/index.html index 29102ab..de625fb 100644 --- a/index.html +++ b/index.html @@ -939,11 +939,10 @@

        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. + given urls MUST be used as the list of presentation + request URLs which are each a possible presentation URL + for the PresentationRequest instance.

        @@ -968,17 +967,16 @@

          -
        1. Let presentationUrls be an empty list of URLs.
        2. +
        3. Let presentationUrls be an empty list of URLs. +
        4. For each URL url in urls:
          1. Resolve url relative to the API base URL - specified by the entry settings object, and add the - resulting absolute URL (if any) to - presentationUrls. + specified by the entry settings object, and add the + resulting absolute URL (if any) to presentationUrls.
          2. -
          3. - If the resolve a URL algorithm failed, then throw a - SyntaxError exception and abort all remaining steps. +
          4. If the resolve a URL algorithm failed, then throw a + SyntaxError exception and abort all remaining steps.
        5. @@ -1059,8 +1057,8 @@

          completed.
        6. No member in the list of available presentation - displays is a compatible presentation display for any - member of presentationUrls. + displays is a compatible presentation display for + any member of presentationUrls.
        Then run the following steps:
          @@ -1093,8 +1091,8 @@

          I.
        1. Set the presentation URL of S to the - presentationUrl for D in the list of - available presentation displays. + presentationUrl for D in the list of + available presentation displays.
        2. Set the presentation connection state of S to connecting. @@ -1200,8 +1198,8 @@

          its controlling browsing context is the current browsing context, its presentation connection state is not terminated, its - presentation URL is equal to one of the presentation request - URLs of presentationRequest, and its + presentation URL is equal to one of the presentation + request URLs of presentationRequest, and its presentation identifier is equal to presentationId.

        3. @@ -1237,8 +1235,9 @@

          presentationRequest, and its presentation identifier is equal to presentationId. -
        4. If such a PresentationConnection exists, let E - be that PresentationConnection, and run the following steps: +
        5. If such a PresentationConnection exists, let + E be that PresentationConnection, and run the + following steps:
          1. Create a new PresentationConnection S.
          2. @@ -1365,8 +1364,8 @@

            A is a live PresentationAvailability object;
          3. - availabilityUrl[] is the list of presentation request URLs - when availabilityUrl[] is the list of presentation + request URLs when getAvailability() is called to create A;
          4. @@ -1437,7 +1436,8 @@

            Input

  • - presentationUrls, a list of presentation request URLs + presentationUrls, a list of presentation request + URLs
    Output @@ -1553,8 +1553,8 @@

  • Let newAvailability be true if newDisplays is not empty and at least one display in newDisplays is a compatible presentation - display for at least one member - of availabilityUrls. Otherwise, set + display for at least one member of + availabilityUrls. Otherwise, set newAvailability to false.
  • If previousAvailability is not equal to @@ -2492,11 +2492,11 @@

    receiving browsing context.

    - Given the operating context of the presentation display, some - APIs will not work by design (for example, by requiring user input) - or will be obsolete (for example, by attempting window management); - the receiving user agent should be aware of this. - Furthermore, any modal user interface will need to be handled + Given the operating context of the presentation display, + some APIs will not work by design (for example, by requiring user + input) or will be obsolete (for example, by attempting window + management); the receiving user agent should be aware of + this. Furthermore, any modal user interface will need to be handled carefully.

    @@ -2560,12 +2560,12 @@

    receiving browsing contexts using an implementation specific mechanism.

  • -
  • 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. +
  • 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.
  • Add S to the set of presentation controllers.
  • @@ -2862,16 +2862,15 @@

    Acknowledgments

    - Thanks to Addison Phillips, Anne Van Kesteren, Anssi Kostiainen, - Anton Vayvod, Chris Needham, Christine Runnegar, Daniel Davis, - Domenic Denicola, Erik Wilde, François Daoust, 闵洪波 (Hongbo Min), - Hongki CHA, Hubert Sablonnière, Hyojin Song, Hyun June Kim, - Jean-Claude Dufourd, Joanmarie Diggs, Jonas Sicking, Louay Bassbouss, - Mark Watson, Martin Dürst, Matt Hammond, Mike West, Mounir Lamouri, - Nick Doty, Oleg Beletski, Philip Jägenstedt, Richard Ishida, - Shih-Chiang Chien, Takeshi Kanai, Tobie Langel, Tomoyuki Shimizu, - Travis Leithead, and Wayne Carr for help with editing, reviews and - feedback to this draft. + Thanks to Addison Phillips, Anne Van Kesteren, Anssi Kostiainen, Anton + Vayvod, Chris Needham, Christine Runnegar, Daniel Davis, Domenic + Denicola, Erik Wilde, François Daoust, 闵洪波 (Hongbo Min), Hongki CHA, + Hubert Sablonnière, Hyojin Song, Hyun June Kim, Jean-Claude Dufourd, + Joanmarie Diggs, Jonas Sicking, Louay Bassbouss, Mark Watson, Martin + Dürst, Matt Hammond, Mike West, Mounir Lamouri, Nick Doty, Oleg + Beletski, Philip Jägenstedt, Richard Ishida, Shih-Chiang Chien, Takeshi + Kanai, Tobie Langel, Tomoyuki Shimizu, Travis Leithead, and Wayne Carr + for help with editing, reviews and feedback to this draft.

    From 626b24856a7dcea6c12442680519794779a5ece2 Mon Sep 17 00:00:00 2001 From: "mark a. foltz" Date: Mon, 13 Jun 2016 15:36:01 -0700 Subject: [PATCH 3/7] Update all algorithms and interfaces --- index.html | 96 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 69 insertions(+), 27 deletions(-) diff --git a/index.html b/index.html index de625fb..01a18c8 100644 --- a/index.html +++ b/index.html @@ -940,7 +940,7 @@

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

    @@ -1090,9 +1090,14 @@

  • Set the presentation identifier of S to I.
  • -
  • Set the presentation URL of S to the - presentationUrl for D in the list of - available presentation displays. +
  • For each presentationUrl in presentationUrls in order, run the following step: +
      +
    1. + If there is an entry (presentationUrl, D) in + the list of available presentation displays, then set the presentation URL for S to + presentationUrl and stop iterating. +
    2. +
  • Set the presentation connection state of S to connecting. @@ -1245,7 +1250,7 @@

    presentationId.

  • Set the presentation URL of S to the - presentation request URL of E. + presentation URL of E.
  • Set the presentation connection state of S to
  • The user agent MUST keep a list of available - presentation displays. This current list of presentation + presentation displays. The list of available presentation + displays is represented by a list of + tuples (availabilityUrl, display). An entry in this list + means that display is curently available to start a + presentation and is a compatible presentation display + for availabilityUrl. This list of presentation displays may be used for starting new presentations, and is populated based on an implementation specific discovery mechanism. It is set to the most recent result of the algorithm to monitor @@ -1510,10 +1520,18 @@

  • Let A be a new PresentationAvailability - object with its value property set to - false if the list of available presentation - displays is empty or none of them is a compatible - presentation display, true otherwise. + object with its value property set as follows: +
      +
    1. false if the list of available presentation + displays is empty. +
    2. true if there is at least one compatible + presentation display for some member of + of presentationUrls. That is, there is an + entry (availabilityUrl, display) in the + list of available presentation displays where availabiltyUrl is a member of presentationUrls. +
    3. +
    4. false otherwise.
    5. +
  • Create a tuple (A, presentationUrls) and add it to the set of @@ -1539,23 +1557,36 @@

    running the following steps.

      +
    1. + Set the list of available presentation displays to the empty list. +
    2. Retrieve available presentation displays (using an implementation specific mechanism) and let newDisplays be this list.
    3. For each member (A, availabilityUrls) of the set of availability - objects: + objects, run the following steps:
      1. Set previousAvailability to the value of - A's value property. + A's value property.
      2. -
      3. Let newAvailability be true if - newDisplays is not empty and at least one display in - newDisplays is a compatible presentation - display for at least one member of - availabilityUrls. Otherwise, set - newAvailability to false. +
      4. Let newAvailability be false.
      5. +
      6. For each availabilityUrl in availabilityUrls, run the following steps: +
          +
        1. + For each display in newDisplays, if display is a + compatible presentation display for availabilityUrl, then + run the following steps: +
            +
          1. Insert a tuple (availabilityUrl, display) + into the list of available presentation + displays (if no identical tuple already + exists).
          2. +
          3. Set newAvailability to true.
          4. +
          +
        2. +
      7. If previousAvailability is not equal to newAvailability, then queue a task to run the @@ -1572,9 +1603,6 @@

    4. -
    5. Set the list of available presentation displays to the - value of newDisplays. -

    When a PresentationAvailability object is no longer alive @@ -1586,11 +1614,12 @@

    availabilityUrl) in the set of availability objects for the newly deceased A.

  • -
  • If the set of availability objects is now empty and - there is no pending request to start a presentation, cancel any pending task - to monitor the list of available presentation displays for - power saving purposes. +
  • If the set of availability objects is now empty and there + is no pending request to start a presentation, cancel any pending task + to monitor the list of available presentation displays for + power saving purposes, and set the list of available presentation + displays to the empty list.
  • @@ -1661,6 +1690,7 @@

    interface PresentationConnection : EventTarget { readonly attribute DOMString? id; + readonly attribute DOMString url; readonly attribute PresentationConnectionState state; void close(); void terminate(); @@ -1684,6 +1714,10 @@

    The id attribute specifies the presentation connection's presentation identifier.

    +

    + The url attribute specifies the + presentation connection's presentation URL. +

    The state attribute represents the presentation connection's current state. It can take one of @@ -2470,7 +2504,7 @@

    Navigate C to presentationUrl.
  • Start monitoring incoming presentation connections for - C with presentationId. + C with presentationId and presentationUrl.
  • @@ -2546,6 +2580,11 @@

    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, @@ -2556,6 +2595,9 @@

    2. Set the presentation identifier of S to I.
    3. +
    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. From 9c5cea3a09892eccdf4b3e35aeaa940677738eb3 Mon Sep 17 00:00:00 2001 From: "mark a. foltz" Date: Mon, 13 Jun 2016 15:36:11 -0700 Subject: [PATCH 4/7] tidy --- index.html | 106 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 60 insertions(+), 46 deletions(-) diff --git a/index.html b/index.html index 01a18c8..a54a89c 100644 --- a/index.html +++ b/index.html @@ -940,9 +940,9 @@

      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. + "presentation request URL">presentation request URLs which are + each a possible presentation URL for the + PresentationRequest instance.

      @@ -1090,12 +1090,13 @@

    6. Set the presentation identifier of S to I.
    7. -
    8. For each presentationUrl in presentationUrls in order, run the following step: +
    9. For each presentationUrl in + presentationUrls in order, run the following step:
        -
      1. - If there is an entry (presentationUrl, D) in - the list of available presentation displays, then set the presentation URL for S to - presentationUrl and stop iterating. +
      2. If there is an entry (presentationUrl, D) in the + list of available presentation displays, then set the + presentation URL for S to + presentationUrl and stop iterating.
    10. @@ -1383,11 +1384,11 @@

      The user agent MUST keep a list of available presentation displays. The list of available presentation - displays is represented by a list of - tuples (availabilityUrl, display). An entry in this list - means that display is curently available to start a - presentation and is a compatible presentation display - for availabilityUrl. This list of presentation + displays is represented by a list of tuples + (availabilityUrl, display). An entry in this list means + that display is curently available to start a + presentation and is a compatible presentation display for + availabilityUrl. This list of presentation displays may be used for starting new presentations, and is populated based on an implementation specific discovery mechanism. It is set to the most recent result of the algorithm to monitor @@ -1520,18 +1521,25 @@

  • Let A be a new PresentationAvailability - object with its value property set as follows: + object with its value property set as follows:
      -
    1. false if the list of available presentation - displays is empty. -
    2. true if there is at least one compatible - presentation display for some member of - of presentationUrls. That is, there is an - entry (availabilityUrl, display) in the - list of available presentation displays where availabiltyUrl is a member of presentationUrls. +
    3. + false if the list of available presentation + displays is empty. +
    4. +
    5. + true if there is at least one compatible + presentation display for some member of of + presentationUrls. That is, there is an entry + (availabilityUrl, display) in the list of + available presentation displays where + availabiltyUrl is a member of + presentationUrls. +
    6. +
    7. + false otherwise.
    8. -
    9. false otherwise.
    10. -
    +
  • Create a tuple (A, presentationUrls) and add it to the set of @@ -1557,8 +1565,8 @@

    running the following steps.

      -
    1. - Set the list of available presentation displays to the empty list. +
    2. Set the list of available presentation displays to the + empty list.
    3. Retrieve available presentation displays (using an implementation specific mechanism) and let newDisplays @@ -1569,21 +1577,26 @@

      objects, run the following steps:
      1. Set previousAvailability to the value of - A's value property. + A's value property. +
      2. +
      3. Let newAvailability be false.
      4. -
      5. Let newAvailability be false.
      6. -
      7. For each availabilityUrl in availabilityUrls, run the following steps: +
      8. For each availabilityUrl in + availabilityUrls, run the following steps:
          -
        1. - For each display in newDisplays, if display is a - compatible presentation display for availabilityUrl, then - run the following steps: +
        2. For each display in newDisplays, + if display is a compatible presentation + display for availabilityUrl, then run the + following steps:
            -
          1. Insert a tuple (availabilityUrl, display) - into the list of available presentation - displays (if no identical tuple already - exists).
          2. -
          3. Set newAvailability to true.
          4. +
          5. Insert a tuple (availabilityUrl, + display) into the list of available + presentation displays (if no identical tuple + already exists). +
          6. +
          7. Set newAvailability to + true. +
        @@ -1614,12 +1627,12 @@

        availabilityUrl) in the set of availability objects for the newly deceased A.

      9. -
      10. If the set of availability objects is now empty and there - is no pending request to start a presentation, cancel any pending task - to monitor the list of available presentation displays for - power saving purposes, and set the list of available presentation - displays to the empty list. +
      11. If the set of availability objects is now empty and + there is no pending request to start a presentation, cancel any pending task + to monitor the list of available presentation displays for + power saving purposes, and set the list of available + presentation displays to the empty list.
      @@ -2504,7 +2517,8 @@

      Navigate C to presentationUrl.

    4. Start monitoring incoming presentation connections for - C with presentationId and presentationUrl. + C with presentationId and + presentationUrl.

    @@ -2595,8 +2609,8 @@

  • Set the presentation identifier of S to I.
  • -
  • - Set the presentation URL of S to presentationUrl. +
  • Set the presentation URL of S to + presentationUrl.
  • Establish the connection between the controlling and receiving browsing contexts using an implementation specific From 6aceff5f9b53f2e861e6839a17a9ac155f85178d Mon Sep 17 00:00:00 2001 From: "mark a. foltz" Date: Mon, 13 Jun 2016 16:05:07 -0700 Subject: [PATCH 5/7] Minor edits --- index.html | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index a54a89c..98c66e1 100644 --- a/index.html +++ b/index.html @@ -1373,7 +1373,7 @@

    availabilityUrl[] is the list of presentation request URLs when getAvailability() is called to - create A; + create A.

  • @@ -1388,7 +1388,7 @@

    (availabilityUrl, display). An entry in this list means that display is curently available to start a presentation and is a compatible presentation display for - availabilityUrl. This list of presentation + availabilityUrl. This list of presentation displays may be used for starting new presentations, and is populated based on an implementation specific discovery mechanism. It is set to the most recent result of the algorithm to monitor @@ -1531,10 +1531,9 @@

    true if there is at least one compatible presentation display for some member of of presentationUrls. That is, there is an entry - (availabilityUrl, display) in the list of - available presentation displays where - availabiltyUrl is a member of - presentationUrls. + (presentationUrl, display) in the list of + available presentation displays for some + presentationUrl in presentationUrls.
  • false otherwise. @@ -1582,7 +1581,7 @@

  • Let newAvailability be false.
  • For each availabilityUrl in - availabilityUrls, run the following steps: + availabilityUrls, run the following step:
    1. For each display in newDisplays, if display is a compatible presentation @@ -1591,8 +1590,8 @@

      1. Insert a tuple (availabilityUrl, display) into the list of available - presentation displays (if no identical tuple - already exists). + presentation displays, if no identical tuple + already exists.
      2. Set newAvailability to true. From beba2e92f385ed333afcc12128a11785f3c21ab3 Mon Sep 17 00:00:00 2001 From: "mark a. foltz" Date: Thu, 16 Jun 2016 14:02:58 -0700 Subject: [PATCH 6/7] Make changes suggested by @tidoust --- index.html | 57 +++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/index.html b/index.html index edfb565..e9e844c 100644 --- a/index.html +++ b/index.html @@ -519,7 +519,7 @@

        var presentBtn = document.getElementById("presentBtn"); // It is also possible to use relative presentation URL e.g. "presentation.html" var presUrls = ["http://example.com/presentation.html", - "http://another.com/alternate.html"]; + "http://example.net/alternate.html"]; // show or hide present button depending on display availability var handleAvailabilityChange = function(available) { presentBtn.style.display = available ? "inline" : "none"; @@ -854,16 +854,16 @@

        If set by the controller, the value of the defaultRequest attribute SHOULD be used by the controlling user agent as the default presentation - request for that controlling browsing context. If the - the document object's active sandboxing flag set has - the sandboxed presentation browsing context flag set, - the controlling user agent SHOULD act as if the default - request is not set for that browsing context. When - the controlling user agent wishes to initiate a - PresentationConnection on the behalf of that browsing - context, it MUST start a presentation using the default - presentation request for the controller (as if the - controller had called defaultRequest.start()). + request for that controlling browsing context. If the + the document object's active sandboxing flag set has the + sandboxed presentation browsing context flag set, the + controlling user agent SHOULD act as if the default request + is not set for that browsing context. When the controlling user + agent wishes to initiate a PresentationConnection on the + behalf of that browsing context, it MUST start a + presentation using the default presentation request for + the controller (as if the controller had called + defaultRequest.start()).

        The controlling user agent SHOULD initiate presentation @@ -929,6 +929,7 @@

        Interface PresentationRequest

        +          [Constructor(DOMString url)]
                   [Constructor(DOMString[] urls)]
                   interface PresentationRequest : EventTarget {
                     Promise<PresentationConnection> start();
        @@ -968,7 +969,8 @@ 

        Input

  • - urls, the list of presentation request URLs + url or urls, the presentation request + URLs
    Output @@ -978,13 +980,17 @@

      +
    1. If the constructor that take a single url was + invoked, let urls be a one item list with url + as its only member. +
    2. Let presentationUrls be an empty list of URLs.
    3. -
    4. For each URL url in urls: +
    5. For each URL U in urls:
        -
      1. Resolve url relative to the API base URL - specified by the entry settings object, and add the - resulting absolute URL (if any) to presentationUrls. +
      2. Resolve U relative to the API base URL specified + by the entry settings object, and add the resulting + absolute URL (if any) to presentationUrls.
      3. If the resolve a URL algorithm failed, then throw a SyntaxError exception and abort all remaining steps. @@ -1101,15 +1107,10 @@

      4. Set the presentation identifier of S to I.
      5. -
      6. For each presentationUrl in - presentationUrls in order, run the following step: -
          -
        1. If there is an entry (presentationUrl, D) in the - list of available presentation displays, then set the - presentation URL for S to - presentationUrl and stop iterating. -
        2. -
        +
      7. Set the presentation URL for S to the first + presentationUrl in presentationUrls for which + there exists an entry (presentationUrl, D) in the + list of available presentation displays.
      8. Set the presentation connection state of S to connecting. @@ -1540,7 +1541,7 @@

      9. true if there is at least one compatible - presentation display for some member of of + presentation display for some member of presentationUrls. That is, there is an entry (presentationUrl, display) in the list of available presentation displays for some @@ -1791,8 +1792,8 @@

        When the terminate() method is called on a PresentationConnection S in a receiving browsing context, the user agent MUST run the algorithm - to terminate a presentation in a receiving browsing - context using S. + to terminate a presentation in a receiving browsing context + using S.

        When a PresentationConnection object is created, its From 5b6ff798d7aa94ebab16b2c55a597fad6fc56ae1 Mon Sep 17 00:00:00 2001 From: "mark a. foltz" Date: Thu, 16 Jun 2016 14:14:01 -0700 Subject: [PATCH 7/7] Fix WebIDL syntax and improve some wording. --- index.html | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index e9e844c..8d5ba47 100644 --- a/index.html +++ b/index.html @@ -929,8 +929,8 @@

        Interface PresentationRequest

        -          [Constructor(DOMString url)]
        -          [Constructor(DOMString[] urls)]
        +          [Constructor(DOMString url),
        +           Constructor(DOMString[] urls)]
                   interface PresentationRequest : EventTarget {
                     Promise<PresentationConnection> start();
                     Promise<PresentationConnection> reconnect(DOMString presentationId);
        @@ -980,9 +980,8 @@ 

          -
        1. If the constructor that take a single url was - invoked, let urls be a one item list with url - as its only member. +
        2. If a single url was provided, let urls be + a one item array containing url.
        3. Let presentationUrls be an empty list of URLs.
        4. @@ -998,8 +997,8 @@

      10. Construct a new PresentationRequest object with - presentationUrls as the constructor argument and return - it. + presentationUrls as its presentation request URLs + and return it.