Skip to content

Commit

Permalink
Incorpoarting Mark Foltz changes from pull request #7.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Röttsches committed Sep 5, 2014
1 parent e433f63 commit c331617
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 79 deletions.
67 changes: 30 additions & 37 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
</style>
<link rel="stylesheet" href=
"http://www.w3.org/community/src/css/spec/cg-final.css" type="text/css">
"http://www.w3.org/community/src/css/spec/cg-draft.css" type="text/css">
<style type="text/css">
/* Note formatting taken from HTML5 spec */
.note { border-left-style: solid; border-left-width: 0.25em; background: none repeat scroll 0 0 #E9FBE9; border-color: #52E052; }
Expand Down Expand Up @@ -74,7 +74,7 @@ <h1>
Presentation API
</h1>
<h2 class="no-num no-toc">
Final Report [DATE]
Draft Report - [DATE]
</h2>
<dl>
<dt>
Expand Down Expand Up @@ -511,8 +511,8 @@ <h2>
selected, the session is resumed by establishing a communication channel.
If a new screen was selected, the UA connects to the selected screen,
brings up a new window on the selected screen, starts to show the content
denoted by the url argument, and the UA establishes a communication
channel with this window.
denoted by the <code>url</code> argument, and the UA establishes a
communication channel with this window.
</p>
<p>
When the <code>navigator.presentation.requestSession(url)</code> function
Expand Down Expand Up @@ -561,16 +561,22 @@ <h4>
</p>
<h3>
Usage on Remote Screen
</h3>For addressing the requirement of communication between originating
page and presentation page/screen, we can now use the same
<code>session</code> object on the remote side.
</h3>
<p>
For addressing the requirement of communication between originating page
and presentation page/screen, the presenting page can now use the same
<code>session</code> object. It accesses this object through the
<code>navigator.presentation.session</code> property, which is only
non-<code>null</code> for the page on the presentation screen.
</p>
<pre class="example">
navigator.presentation.onpresent = function(e) {
if (navigator.presentation.session) {
var session = navigator.presentation.session;
// Communicate with opener page.
e.session.postMessage(/*...*/);
e.session.onmessage = function() {/*...*/};
session.postMessage(/*...*/);
session.onmessage = function() {/*...*/};

e.session.onstatechange = function() {
session.onstatechange = function() {
switch (this.state) {
case "disconnected":
// Handle disconnection from opener page.
Expand All @@ -579,23 +585,23 @@ <h3>
};
</pre>
<p>
When the content denoted by the url argument in the
When the content denoted by the <code>url</code> argument in the
<code>requestSession()</code> example above is loaded, the page on the
presentation screen receives a <code>PresentEvent</code>, with a
<code>session</code> property representing the session. This session is a
similar object as in the first example. Here, its initial state is
<code>"connected"</code>, which means we can use it to communicate with
the opener page using <code>postMessage()</code> and
presentation screen will have its
<code>navigator.presentation.session</code> property set to the session.
This session is a similar object as in the first example. Here, its
initial state is <code>"connected"</code>, which means we can use it to
communicate with the opener page using <code>postMessage()</code> and
<code>onmessage</code>.
</p>
<p>
We can also monitor the connection state by listening for
<code>statechange</code> events. When the state changes to
The presentation page can also monitor the connection state by listening
for <code>statechange</code> events. When the state changes to
<code>"disconnected"</code> the page is made aware of the fact that
communication with the opener page was lost, but it can continue to
display the current content. The communication can be re-established when
a new present event fires on the <code>navigator.presentation</code>
object.
a <code>statechange</code> event fires with a new state of
<code>"connected"</code>.
</p>
<h2>
Interfaces
Expand All @@ -617,9 +623,9 @@ <h3>
</h3>
<pre class="idl">
interface NavigatorPresentation : EventTarget {
readonly attribute PresentationSession? session;
PresentationSession requestSession(DOMString url);
attribute EventHandler onavailablechange;
attribute EventHandler onpresent;
};

partial interface Navigator {
Expand All @@ -642,20 +648,6 @@ <h3>
dictionary AvailableChangeEventInit : EventInit {
boolean available;
};
</pre>
<h3>
<code>PresentEvent</code>
</h3>Fired at the secondary screen's <code>NavigatorPresentation</code>
object, when the presentation session is established.
<pre class="idl">
[Constructor(DOMString type, optional PresentEventInit eventInitDict)]
interface PresentEvent : Event {
readonly attribute PresentationSession session;
};

dictionary PresentEventInit : EventInit {
PresentationSession session;
};
</pre>
<h3>
<code>PresentationSession</code>
Expand Down Expand Up @@ -683,7 +675,8 @@ <h2 class="no-num">
</h2>
<p>
Thanks to Wayne Carr, Louay Bassbous, Anssi Kostiainen, 闵洪波 (Hongbo Min),
Anton Vayvod for help with editing, reviews and feedback to this draft.
Anton Vayvod, and Mark Foltz for help with editing, reviews and feedback
to this draft.
</p>
</body>
</html>
75 changes: 33 additions & 42 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[data-anolis-spec]::after { content:"[" attr(data-anolis-spec) "]"; font-size:.6em; vertical-align:super; text-transform:uppercase }
}
</style>
<link href="http://www.w3.org/community/src/css/spec/cg-final.css" rel="stylesheet" type="text/css">
<link href="http://www.w3.org/community/src/css/spec/cg-draft.css" rel="stylesheet" type="text/css">
<style type="text/css">
/* Note formatting taken from HTML5 spec */
.note { border-left-style: solid; border-left-width: 0.25em; background: none repeat scroll 0 0 #E9FBE9; border-color: #52E052; }
Expand Down Expand Up @@ -73,8 +73,8 @@
<h1>
Presentation API
</h1>
<h2 class="no-num no-toc" id="final-report-16-july-2014">
Final Report 16 July 2014
<h2 class="no-num no-toc" id="draft-report-5-september-2014">
Draft Report - 5 September 2014
</h2>
<dl>
<dt>
Expand Down Expand Up @@ -220,10 +220,7 @@ <h2 class="no-num no-toc" id="table-of-contents">
<li><a href="#availablechangeevent"><span class="secno">6.2 </span>
<code>AvailableChangeEvent</code>
</a></li>
<li><a href="#presentevent"><span class="secno">6.3 </span>
<code>PresentEvent</code>
</a></li>
<li><a href="#presentationsession"><span class="secno">6.4 </span>
<li><a href="#presentationsession"><span class="secno">6.3 </span>
<code>PresentationSession</code>
</a></ol></li>
<li><a class="no-num" href="#references">
Expand Down Expand Up @@ -569,8 +566,8 @@ <h2 id="example"><span class="secno">5 </span>
selected, the session is resumed by establishing a communication channel.
If a new screen was selected, the UA connects to the selected screen,
brings up a new window on the selected screen, starts to show the content
denoted by the url argument, and the UA establishes a communication
channel with this window.
denoted by the <code>url</code> argument, and the UA establishes a
communication channel with this window.
</p>
<p>
When the <code>navigator.presentation.requestSession(url)</code> function
Expand Down Expand Up @@ -619,15 +616,21 @@ <h4 id="open-questions"><span class="secno">5.1 </span>
</p>
<h3 id="usage-on-remote-screen"><span class="secno">5.2 </span>
Usage on Remote Screen
</h3>For addressing the requirement of communication between originating
page and presentation page/screen, we can now use the same
<code>session</code> object on the remote side.
<pre class="example">navigator.presentation.onpresent = function(e) {
</h3>
<p>
For addressing the requirement of communication between originating page
and presentation page/screen, the presenting page can now use the same
<code>session</code> object. It accesses this object through the
<code>navigator.presentation.session</code> property, which is only
non-<code>null</code> for the page on the presentation screen.
</p>
<pre class="example">if (navigator.presentation.session) {
var session = navigator.presentation.session;
// Communicate with opener page.
e.session.postMessage(/*...*/);
e.session.onmessage = function() {/*...*/};
session.postMessage(/*...*/);
session.onmessage = function() {/*...*/};

e.session.onstatechange = function() {
session.onstatechange = function() {
switch (this.state) {
case "disconnected":
// Handle disconnection from opener page.
Expand All @@ -636,23 +639,23 @@ <h3 id="usage-on-remote-screen"><span class="secno">5.2 </span>
};
</pre>
<p>
When the content denoted by the url argument in the
When the content denoted by the <code>url</code> argument in the
<code>requestSession()</code> example above is loaded, the page on the
presentation screen receives a <code>PresentEvent</code>, with a
<code>session</code> property representing the session. This session is a
similar object as in the first example. Here, its initial state is
<code>"connected"</code>, which means we can use it to communicate with
the opener page using <code>postMessage()</code> and
presentation screen will have its
<code>navigator.presentation.session</code> property set to the session.
This session is a similar object as in the first example. Here, its
initial state is <code>"connected"</code>, which means we can use it to
communicate with the opener page using <code>postMessage()</code> and
<code>onmessage</code>.
</p>
<p>
We can also monitor the connection state by listening for
<code>statechange</code> events. When the state changes to
The presentation page can also monitor the connection state by listening
for <code>statechange</code> events. When the state changes to
<code>"disconnected"</code> the page is made aware of the fact that
communication with the opener page was lost, but it can continue to
display the current content. The communication can be re-established when
a new present event fires on the <code>navigator.presentation</code>
object.
a <code>statechange</code> event fires with a new state of
<code>"connected"</code>.
</p>
<h2 id="interfaces"><span class="secno">6 </span>
Interfaces
Expand All @@ -672,9 +675,9 @@ <h3 id="navigatorpresentation"><span class="secno">6.1 </span>
<code>NavigatorPresentation</code>
</h3>
<pre class="idl">interface NavigatorPresentation : EventTarget {
readonly attribute PresentationSession? session;
PresentationSession requestSession(DOMString url);
attribute EventHandler onavailablechange;
attribute EventHandler onpresent;
};

partial interface Navigator {
Expand All @@ -697,20 +700,7 @@ <h3 id="availablechangeevent"><span class="secno">6.2 </span>
boolean available;
};
</pre>
<h3 id="presentevent"><span class="secno">6.3 </span>
<code>PresentEvent</code>
</h3>Fired at the secondary screen's <code>NavigatorPresentation</code>
object, when the presentation session is established.
<pre class="idl">[Constructor(DOMString type, optional PresentEventInit eventInitDict)]
interface PresentEvent : Event {
readonly attribute PresentationSession session;
};

dictionary PresentEventInit : EventInit {
PresentationSession session;
};
</pre>
<h3 id="presentationsession"><span class="secno">6.4 </span>
<h3 id="presentationsession"><span class="secno">6.3 </span>
<code>PresentationSession</code>
</h3>
<p>
Expand Down Expand Up @@ -744,7 +734,8 @@ <h2 class="no-num" id="acknowledgements">
</h2>
<p>
Thanks to Wayne Carr, Louay Bassbous, Anssi Kostiainen, 闵洪波 (Hongbo Min),
Anton Vayvod for help with editing, reviews and feedback to this draft.
Anton Vayvod, and Mark Foltz for help with editing, reviews and feedback
to this draft.
</p>


0 comments on commit c331617

Please sign in to comment.