Skip to content

Commit 97ff618

Browse files
clellandfoolip
authored andcommitted
Refer to feature policy spec (#107)
This change defines Fullscreen as a policy-controlled feature, referencing the feature policy spec. It makes use of the currently- monkey-patched "Allowed to use" algorithm in HTML to allow the document's policy to control whether an element is permitted to go fullscreen. Fixes: #106 Tests: #107 (comment)
1 parent 6e49fbc commit 97ff618

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

fullscreen.bs

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ if all of the following are true, and false otherwise:
204204
<ul>
205205
<li><p><var>element</var> is <a>connected</a>.
206206

207-
<li><p><var>element</var>'s <a>node document</a> is <a>allowed to use</a> the feature indicated by
208-
attribute name <code>allowfullscreen</code>.
207+
<li><p><var>element</var>'s <a>node document</a> is <a>allowed to use</a> the "<code><a
208+
data-lt="fullscreen-feature">fullscreen</a></code>" feature.
209209
<!-- cross-process, recursive -->
210210
</ul>
211211

@@ -310,8 +310,9 @@ these steps:
310310
exercise to the reader. Input welcome on potential improvements.
311311

312312
<p>The <dfn attribute for=Document><code>fullscreenEnabled</code></dfn> attribute's getter must
313-
return true if the <a>context object</a> is <a>allowed to use</a> the feature indicated by attribute
314-
name <code>allowfullscreen</code> and <a>fullscreen is supported</a>, and false otherwise.
313+
return true if the <a>context object</a> is <a>allowed to use</a> the "<code><a
314+
data-lt="fullscreen-feature">fullscreen</a></code>" feature and <a>fullscreen is supported</a>, and
315+
false otherwise.
315316

316317
<p>The <dfn attribute for=Document><code>fullscreen</code></dfn> attribute's getter must return
317318
false if <a>context object</a>'s <a>fullscreen element</a> is null, and true otherwise.
@@ -629,6 +630,25 @@ iframe:fullscreen {
629630

630631

631632

633+
<h2 id=feature-policy-integration>Feature Policy Integration</h2>
634+
635+
<p>This specification defines a <a>policy-controlled feature</a> identified by the string
636+
"<code><dfn data-lt="fullscreen-feature">fullscreen</dfn></code>". Its <a>default allowlist</a> is
637+
<code>'self'</code>.
638+
639+
<div class="note">
640+
<p>A <a>document</a>'s <a>feature policy</a> determines whether any content in that document is allowed to
641+
go fullscreen. If disabled in any document, no content in the document will be <a>allowed to use</a>
642+
fullscreen.
643+
644+
<p>The <{iframe/allowfullscreen}> attribute of the HTML <{iframe}> element affects the <a>container
645+
policy</a> for any document nested in that iframe. Unless overridden by the <{iframe/allow}>
646+
attribute, setting <{iframe/allowfullscreen}> on an iframe is equivalent to <code>&lt;iframe
647+
allow="fullscreen *"&gt;</code>, as described in
648+
[[FEATURE-POLICY#iframe-allowfullscreen-attribute]].
649+
</div>
650+
651+
632652
<h2 id=security-and-privacy-considerations>Security and Privacy Considerations</h2>
633653

634654
<p>User agents should ensure, e.g. by means of an overlay, that the end user is aware something is
@@ -638,8 +658,12 @@ user agent or even operating system environment when fullscreen. See also the de
638658
{{Element/requestFullscreen()}}.
639659

640660
<p>To enable content in a <a>nested browsing context</a> to go fullscreen, it needs to be
641-
specifically allowed via the <code>allowfullscreen</code> attribute of the HTML <{iframe}> element.
642-
This prevents e.g. content from third parties to go fullscreen without explicit permission.
661+
specifically allowed via feature policy, either through the <{iframe/allowfullscreen}> attribute of
662+
the HTML <{iframe}> element, or an appropriate declaration in the <{iframe/allow}> attribute of the
663+
HTML <{iframe}> element, or through a `<a http-header><code>Feature-Policy</code></a>` HTTP header
664+
delivered with the <a>document</a> through which it is nested.
665+
666+
<p>This prevents e.g. content from third parties to go fullscreen without explicit permission.
643667

644668

645669

@@ -655,6 +679,7 @@ Darin Fisher,
655679
<i>fantasai</i>,
656680
Giuseppe Pascale,
657681
Glenn Maynard,
682+
Ian Clelland,
658683
Ian Hickson,
659684
Ignacio Solla,
660685
João Eiras,

0 commit comments

Comments
 (0)