Skip to content

Commit

Permalink
Snapshot allowpaymentrequest and allowusermedia attributes
Browse files Browse the repository at this point in the history
New allow* attributes should use the snapshot model used by <iframe sandbox> and Feature Policy. The allowfullscreen attributes is left with its current live behavior in this change, because it is not yet clear if it is web-compatible to change it (see #2187).

Test: web-platform-tests/wpt#4369.

Part of #2143.
  • Loading branch information
zcorpan authored and annevk committed Jan 14, 2017
1 parent 5baa387 commit b3224a8
Showing 1 changed file with 50 additions and 5 deletions.
55 changes: 50 additions & 5 deletions source
Expand Up @@ -28676,14 +28676,55 @@ interface <dfn>HTMLIFrameElement</dfn> : <span>HTMLElement</span> {
<li><p>If <var>document</var>'s <span data-x="concept-document-bc">browsing context</span> is a
<span>top-level browsing context</span>, then return true.</p></li>

<li><p>If <var>document</var>'s <span data-x="concept-document-bc">browsing context</span> has a
<span>browsing context container</span> that is an <code>iframe</code> element with an
<var>allowattribute</var> attribute specified, and whose <span>node document</span> is
<span>allowed to use</span> the feature indicated by <var>allowattribute</var>, then return
true.</p></li>
<li>
<p>If <var>allowattribute</var> is <code
data-x="attr-iframe-allowfullscreen">allowfullscreen</code>, then follow these substeps:</p>

<ol>
<li><p>If <var>document</var>'s <span data-x="concept-document-bc">browsing context</span> has
a <span>browsing context container</span> that is an <code>iframe</code> element with an
<var>allowattribute</var> attribute specified, and whose <span>node document</span> is
<span>allowed to use</span> the feature indicated by <var>allowattribute</var>, then return
true.</p></li>
</ol>

<p class="big-issue">This step is legacy behavior for the <code
data-x="attr-iframe-allowfullscreen">allowfullscreen</code> attribute that should not be used
for new features. If possible this will be removed, see <a
href="https://github.com/whatwg/html/issues/2143#issuecomment-265514585">issue 2143</a>.</p>
</li>

<li>
<p>Otherwise, follow these substeps:</p>

<ol>
<li><p>If <var>document</var> has the <var><var>allowattribute</var> flag</var> set, and
<var>document</var>'s <span data-x="concept-document-bc">browsing context</span> has a
<span>browsing context container</span> that is an <code>iframe</code> element whose
<span>node document</span> is <span>allowed to use</span> the feature indicated by
<var>allowattribute</var>, then return true.</p></li>
</ol>
</li>

<li><p>Return false.</p></li>
</ol>

<p>To <dfn>set the allow* flags</dfn> for a <code>Document</code> <var>document</var> means to
run these steps:</p>

<ol>
<li><p>If <var>document</var>'s <span data-x="concept-document-bc">browsing context</span> has a
<span>browsing context container</span> that is an <code>iframe</code> element, let
<var>iframe</var> be that element. Otherwise, abort these steps.</p></li>

<li><p>If <var>iframe</var> has an <code
data-x="attr-iframe-allowpaymentrequest">allowpaymentrequest</code> attribute specified, then
set the <var>allowpaymentrequest flag</var> on <var>document</var>.</p></li>

<li><p>If <var>iframe</var> has an <code
data-x="attr-iframe-allowusermedia">allowusermedia</code> attribute specified, then set the
<var>allowusermedia flag</var> on <var>document</var>.</p></li>
</ol>
</div>

<hr> <!-- DIM ATTRIBUTES -->
Expand Down Expand Up @@ -76644,6 +76685,8 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {

<li><p><span>Implement the sandboxing</span> for <var>document</var>.</p></li>

<li><p><span>Set the allow* flags</span> for <var>document</var>.</p></li>

<li><p>Set <var>settingsObject</var>'s <span
data-x="concept-environment-execution-ready-flag">execution ready flag</span>.</p></li>

Expand Down Expand Up @@ -81905,6 +81948,8 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O

<li><p><span>Implement the sandboxing</span> for the <code>Document</code>.</p></li>

<li><p><span>Set the allow* flags</span> for the <code>Document</code>.</p></li>

<li><p>Set <var>settingsObject</var>'s <span
data-x="concept-environment-execution-ready-flag">execution ready flag</span>.</p></li>

Expand Down

0 comments on commit b3224a8

Please sign in to comment.