Skip to content

Clarify the default presentation request mechanism? #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 40 additions & 38 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,12 @@ <h3>
represented by a <a>Promise</a> that resolves with the
<a>presentation controllers monitor</a>.
</p>
<p>
In a <a>controlling browsing context</a>, the <dfn>default
presentation request</dfn>, which is initially set to
<code>null</code>, represents the request to use when the user wishes
to initiate a <a>presentation connection</a> from the browser.
</p>
</section>
<section>
<h3>
Expand All @@ -870,43 +876,48 @@ <h3>
<h4>
Controlling user agent
</h4>
<p>
<a data-lt="controlling user agent">Controlling user agents</a>
MUST implement the following partial interface:
</p>
<pre class="idl idl-controlling-ua">
partial interface Presentation {
attribute PresentationRequest? defaultRequest;
};

</pre>
<p>
In a <a>controlling user agent</a>, the <dfn for=
"Presentation"><code>defaultRequest</code></dfn> attribute MUST
return the <a>default presentation request</a> if any,
<code>null</code> otherwise. In a <a>receiving browsing
context</a>, it MUST return <code>null</code>.
</p>
<p>
If set by the <a>controller</a>, the value of the <a for=
"Presentation">defaultRequest</a> attribute SHOULD be used by the
<a>controlling user agent</a> as the <dfn>default presentation
request</dfn> for that <a>controlling browsing context</a>. If the
the document object's <a>active sandboxing flag set</a> has the
<a>sandboxed presentation browsing context flag</a> set, the
<a>controlling user agent</a> SHOULD consider the <a>default
presentation request</a> for that browsing context to be
<code>null</code>. When the <a>controlling user agent</a> wishes to
initiate a <a>PresentationConnection</a> on the behalf of that
browsing context, it MUST <a>start a presentation</a> using the
<a>default presentation request</a> for the <a>controller</a> (as
if the controller had called <code>defaultRequest.start()</code>).
The <dfn for="Presentation"><code>defaultRequest</code></dfn>
attribute MUST return the <a>default presentation request</a> if
any, <code>null</code> otherwise. On setting, the <a>default
presentation request</a> MUST be set to the new value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implies that the defaultRequest can be set in a receiving browsing context. The spec doesn't have a concrete notion of how a receiving browsing context could be used to initiate its own presentation (the "daisy chaining case") but I don't think we should exclude it.

</p>
<p>
The <a>controlling user agent</a> SHOULD initiate presentation
using the <a>default presentation request</a> only when the user
has expressed an intention to do so via a user gesture, for example
by clicking a button in the browser.
</p>
<p>
To initiate presentation using the <a>default presentation
request</a>, the <a>controlling user agent</a> MUST <a>start a
presentation</a> using the <a>default presentation request</a> (as
if the controller had called <code>defaultRequest.start()</code>),
skipping the first step of that algorithm.
</p>
<div class="note">
Subsequent security steps of the <a>start a presentation</a>
algorithm apply. For instance, the request will fail if the
document object's <a>active sandboxing flag set</a> has the
<a>sandboxed presentation browsing context flag</a> set.
</div>
<p>
Support for the initiation of a <a>presentation connection</a> from
the browser is OPTIONAL.
</p>
<div class="note">
If a <a>controlling user agent</a> does not support initiation of a
<a>presentation connection</a> from the browser chrome, setting
<a>presentation connection</a> from the browser, setting
<code>defaultRequest</code> will have no effect.
</div>
<div class="note">
Expand All @@ -928,33 +939,24 @@ <h4>
<h4>
Receiving user agent
</h4>
<p>
<a data-lt="Receiving user agent">Receiving user agents</a> MUST
implement the following partial interface:
</p>
<pre class="idl idl-receiving-ua">
partial interface Presentation {
[SameObject] readonly attribute PresentationReceiver? receiver;
};

</pre>
<p>
In a <a>receiving user agent</a>, the <dfn for=
"Presentation"><code>receiver</code></dfn> attribute MUST return
the <a><code>PresentationReceiver</code></a> instance associated
with the <a>receiving browsing context</a> and created by the
<a>receiving user agent</a> when the <a>receiving browsing
The <dfn for="Presentation"><code>receiver</code></dfn> attribute
MUST return the <a><code>PresentationReceiver</code></a> instance
associated with the <a>receiving browsing context</a> and created
by the <a>receiving user agent</a> when the <a>receiving browsing
context</a> is created. In any other <a>browsing context</a>, it
MUST return <code>null</code>.
</p>
<p>
A user agent that is a <a>receiving user agent</a> but not a
<a>controlling user agent</a> MUST always return <code>null</code>
for the <a for="Presentation">defaultRequest</a> attribute. It MUST
treat setting the <a for="Presentation">defaultRequest</a>
attribute as a no-op.
</p>
<p>
A user agent that is a <a>controlling user agent</a> but not a
<a>receiving user agent</a> MUST always return <code>null</code>
for the <a for="Presentation">receiver</a> attribute.
</p>
</section>
</section>
<section>
Expand Down