Skip to content

Commit

Permalink
Added defaultsessionstart and default-presentation link element to th…
Browse files Browse the repository at this point in the history
…e spec.
  • Loading branch information
avayvod committed May 14, 2015
1 parent b766e8d commit 82e1b96
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 12 deletions.
61 changes: 56 additions & 5 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,9 @@ <h4>
Launching presentation
</dt>
<dd>
The UA must provide a means of start sending content to the
secondary screen.
The UA must provide a way to start sending content to the
secondary screen. This may occur at the request of the page or at
the request of the UA.
</dd>
<dt>
Resuming presentation
Expand Down Expand Up @@ -597,6 +598,25 @@ <h3>
// no session found for presUrl and presId or an error is occurred
.catch(endSession);
&lt;/script&gt;
</pre>
</section>
<section>
<h3>
Handling an event for a UA initiated presentation session example
</h3>
<pre class="example">
&lt;!-- controller.html --&gt;
&lt;head&gt;
&lt;!-- the link element with rel='default-presentation' allows the page to specify --&gt;
&lt;!-- the presentation URL and id for when the UA initiates a presentation session --&gt;
&lt;link href="http://example.com/presentation.html" rel="default-presentation" id="ABCD1234" &gt;
&lt;/head&gt;
&lt;script&gt;
navigator.presentation.ondefaultsessionstart = function (evt) {
setSession(evt.session);
};
&lt;/script&gt;

</pre>
</section>
<section>
Expand Down Expand Up @@ -685,7 +705,9 @@ <h3>
"w3c-html">browsing context</span> that has initiated or resumed a
<span>presentation session</span> by calling
<code><span>startSession</span>()</code> or
<code><span>joinSession</span>()</code>.
<code><span>joinSession</span>()</code> or received a
<span>presentation session</span> via
<code><span>ondefaultsessionstart</span></code> event.
</p>
<p>
The <dfn>presenting browsing context</dfn> is the browsing context
Expand Down Expand Up @@ -1006,6 +1028,8 @@ <h3>
Promise&lt;<span>PresentationSession</span>&gt; <span>joinSession</span>(DOMString url, DOMString? presentationId);
attribute <span data-anolis-spec=
"w3c-html">EventHandler</span> <span>onavailablechange</span>;
attribute <span data-anolis-spec=
"w3c-html">EventHandler</span> <span>ondefaultsessionstart</span>;
};
</pre>
<p class="open-issue">
Expand Down Expand Up @@ -1392,12 +1416,12 @@ <h5>
registered to the <code>onavailablechange</code> event, the user
agent must run the following steps:
</p>
<ol>
<ul>
<li>If the removed event handler was the last one in the list,
<span>cancel monitoring the list of available presentation
displays</span>.
</li>
</ol>
</ul>
</section>
<section>
<h5>
Expand Down Expand Up @@ -1511,6 +1535,33 @@ <h3>
algorithm determined.
</p>
</section>
<section>
<h3>
<span>Interface <code>DefaultSessionStart</code></span>
</h3>
<pre class="idl">
<span>[Constructor(DOMString type, optional <span>DefaultSessionStartEventInit</span> eventInitDict)]
interface <dfn>DefaultSessionStartEvent</dfn> : Event {
readonly attribute PresentationSession session;
};

dictionary <dfn>DefaultSessionStartEventInit</dfn> : EventInit {
PresentationSession session;
};
</span>


</pre>
<p>
An event named <code>defaultsessionstart</code> is fired when the UA
initiates a presentation on behalf of the page. It is fired at the
<span><code>NavigatorPresentation</code></span> object, using the
<code>DefaultSessionStartEvent</code> interface, with the
<code>session</code> attribute set to the
<span><code>PresentationSession</code></span> object provided by the
UA.
</p>
</section>
</section>
<section>
<h2>
Expand Down
68 changes: 61 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ <h2 class="no-num no-toc" id="table-of-contents">
<li><a href="#joining-a-presentation-session-example"><span class="secno">5.3 </span>
Joining a presentation session example
</a></li>
<li><a href="#monitor-session's-state-and-exchange-data-example"><span class="secno">5.4 </span>
<li><a href="#handling-an-event-for-a-ua-initiated-presentation-session-example"><span class="secno">5.4 </span>
Handling an event for a UA initiated presentation session example
</a></li>
<li><a href="#monitor-session's-state-and-exchange-data-example"><span class="secno">5.5 </span>
Monitor session's state and exchange data example
</a></ol></li>
<li><a href="#api"><span class="secno">6 </span>
Expand Down Expand Up @@ -308,6 +311,9 @@ <h2 class="no-num no-toc" id="table-of-contents">
</a></ol></ol></li>
<li><a href="#interface-availablechangeevent"><span class="secno">6.5 </span>
<span>Interface <code>AvailableChangeEvent</code></span>
</a></li>
<li><a href="#interface-defaultsessionstart"><span class="secno">6.6 </span>
<span>Interface <code>DefaultSessionStart</code></span>
</a></ol></li>
<li><a href="#security-and-privacy-considerations"><span class="secno">7 </span>
Security and privacy considerations
Expand Down Expand Up @@ -479,8 +485,9 @@ <h4 id="functional-requirements"><span class="secno">2.2.1 </span>
Launching presentation
</dt>
<dd>
The UA must provide a means of start sending content to the
secondary screen.
The UA must provide a way to start sending content to the
secondary screen. This may occur at the request of the page or at
the request of the UA.
</dd>
<dt>
Resuming presentation
Expand Down Expand Up @@ -673,7 +680,25 @@ <h3 id="joining-a-presentation-session-example"><span class="secno">5.3 </span>
</pre>
</section>
<section>
<h3 id="monitor-session's-state-and-exchange-data-example"><span class="secno">5.4 </span>
<h3 id="handling-an-event-for-a-ua-initiated-presentation-session-example"><span class="secno">5.4 </span>
Handling an event for a UA initiated presentation session example
</h3>
<pre class="example">&lt;!-- controller.html --&gt;
&lt;head&gt;
&lt;!-- the link element with rel='default-presentation' allows the page to specify --&gt;
&lt;!-- the presentation URL and id for when the UA initiates a presentation session --&gt;
&lt;link href="http://example.com/presentation.html" rel="default-presentation" id="ABCD1234" &gt;
&lt;/head&gt;
&lt;script&gt;
navigator.presentation.ondefaultsessionstart = function (evt) {
setSession(evt.session);
};
&lt;/script&gt;

</pre>
</section>
<section>
<h3 id="monitor-session's-state-and-exchange-data-example"><span class="secno">5.5 </span>
Monitor session's state and exchange data example
</h3>
<pre class="example">&lt;!-- controller.html --&gt;
Expand Down Expand Up @@ -754,7 +779,9 @@ <h3 id="common-idioms"><span class="secno">6.1 </span>
An <dfn id="opening-browsing-context">opening browsing context</dfn> is a <a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/browsers.html#browsing-context">browsing context</a> that has initiated or resumed a
<span>presentation session</span> by calling
<code><a href="#startsession">startSession</a>()</code> or
<code><a href="#joinsession">joinSession</a>()</code>.
<code><a href="#joinsession">joinSession</a>()</code> or received a
<span>presentation session</span> via
<code><span>ondefaultsessionstart</span></code> event.
</p>
<p>
The <dfn id="presenting-browsing-context">presenting browsing context</dfn> is the browsing context
Expand Down Expand Up @@ -1061,6 +1088,7 @@ <h3 id="interface-navigatorpresentation"><span class="secno">6.4 </span>
Promise&lt;<a href="#presentationsession">PresentationSession</a>&gt; <a href="#startsession">startSession</a>(DOMString url, DOMString? presentationId);
Promise&lt;<a href="#presentationsession">PresentationSession</a>&gt; <a href="#joinsession">joinSession</a>(DOMString url, DOMString? presentationId);
attribute <a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/webappapis.html#eventhandler">EventHandler</a> <a href="#onavailablechange">onavailablechange</a>;
attribute <a class="external" data-anolis-spec="w3c-html" href="http://www.w3.org/html/wg/drafts/html/master/webappapis.html#eventhandler">EventHandler</a> <span>ondefaultsessionstart</span>;
};
</pre>
<p class="open-issue">
Expand Down Expand Up @@ -1425,12 +1453,12 @@ <h5 id="removing-an-eventhandler"><span class="secno">6.4.4.2 </span>
registered to the <a href="#onavailablechange"><code>onavailablechange</code></a> event, the user
agent must run the following steps:
</p>
<ol>
<ul>
<li>If the removed event handler was the last one in the list,
<a href="#cancel-monitoring-the-list-of-available-presentation-displays">cancel monitoring the list of available presentation
displays</a>.
</li>
</ol>
</ul>
</section>
<section>
<h5 id="monitoring-the-list-of-available-presentation-displays"><span class="secno">6.4.4.3 </span>
Expand Down Expand Up @@ -1537,6 +1565,32 @@ <h3 id="interface-availablechangeevent"><span class="secno">6.5 </span>
algorithm determined.
</p>
</section>
<section>
<h3 id="interface-defaultsessionstart"><span class="secno">6.6 </span>
<span>Interface <code>DefaultSessionStart</code></span>
</h3>
<pre class="idl"><span>[Constructor(DOMString type, optional <a href="#defaultsessionstarteventinit">DefaultSessionStartEventInit</a> eventInitDict)]
interface <dfn id="defaultsessionstartevent">DefaultSessionStartEvent</dfn> : Event {
readonly attribute PresentationSession session;
};

dictionary <dfn id="defaultsessionstarteventinit">DefaultSessionStartEventInit</dfn> : EventInit {
PresentationSession session;
};
</span>


</pre>
<p>
An event named <code>defaultsessionstart</code> is fired when the UA
initiates a presentation on behalf of the page. It is fired at the
<a href="#navigatorpresentation"><code>NavigatorPresentation</code></a> object, using the
<a href="#defaultsessionstartevent"><code>DefaultSessionStartEvent</code></a> interface, with the
<code>session</code> attribute set to the
<a href="#presentationsession"><code>PresentationSession</code></a> object provided by the
UA.
</p>
</section>
</section>
<section>
<h2 id="security-and-privacy-considerations"><span class="secno">7 </span>
Expand Down
2 changes: 2 additions & 0 deletions xrefs/presentation.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"close-algorithm": "close-algorithm",
"concept-presentation": "concept-presentation",
"concept-presentation-session": "concept-presentation-session",
"defaultsessionstartevent": "defaultsessionstartevent",
"defaultsessionstarteventinit": "defaultsessionstarteventinit",
"destination browsing context": "destination-browsing-context",
"establish a presentation connection": "establish-a-presentation-connection",
"id": "id",
Expand Down

0 comments on commit 82e1b96

Please sign in to comment.