Bug 206806 - Support 'allow="fullscreen"' feature policy
Summary: Support 'allow="fullscreen"' feature policy
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-25 23:00 PST by Jer Noble
Modified: 2020-01-27 12:55 PST (History)
11 users (show)

See Also:


Attachments
Patch (23.85 KB, patch)
2020-01-25 23:08 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (26.83 KB, patch)
2020-01-26 09:46 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (26.86 KB, patch)
2020-01-26 10:11 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (26.86 KB, patch)
2020-01-26 11:56 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (29.04 KB, patch)
2020-01-27 08:27 PST, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2020-01-25 23:00:46 PST
Support 'allow="fullscreen"' feature policy
Comment 1 Jer Noble 2020-01-25 23:01:17 PST
<rdar://problem/55640448>
Comment 2 Jer Noble 2020-01-25 23:08:23 PST
Created attachment 388799 [details]
Patch
Comment 3 youenn fablet 2020-01-26 00:40:54 PST
Comment on attachment 388799 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=388799&action=review

> Source/WebCore/dom/FullscreenManager.cpp:64
> +    }

This code is very similar with UserMediaController isAllowedToUse.
Maybe we should add a routine for crawling up the tree.

> Source/WebCore/html/FeaturePolicy.cpp:148
> +        if (iframe.hasAttribute(allowfullscreenAttr) || iframe.hasAttribute(webkitallowfullscreenAttr)) {

GTK does not like it, unified build issue maybe, HTMLNames.h missing probably.

> LayoutTests/http/tests/fullscreen/fullscreen-feature-policy.html:55
> +    <iframe allow="fullscreen *" data-enabled="true" src="http://localhost:8000/resources/pointer-lock/inner-iframe.html"></iframe>

Maybe add a test like allow="fullscreen http://localhost..."?

Also, there are probably WPT tests that are testing this but there is no rebasing.
Are there some WPT test we should import?
Comment 4 youenn fablet 2020-01-26 00:44:06 PST
Looking at WPT, I see LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allow.html and LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-allowfullscreen.html.

But it seems they fail since they test document.fullscreenEnabled.
It would be nice to add support for it along document.webkitFullscreenEnabled.
Comment 5 Jer Noble 2020-01-26 08:37:46 PST
(In reply to youenn fablet from comment #3)
> Comment on attachment 388799 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=388799&action=review
> 
> > Source/WebCore/dom/FullscreenManager.cpp:64
> > +    }
> 
> This code is very similar with UserMediaController isAllowedToUse.
> Maybe we should add a routine for crawling up the tree.
> 
> > Source/WebCore/html/FeaturePolicy.cpp:148
> > +        if (iframe.hasAttribute(allowfullscreenAttr) || iframe.hasAttribute(webkitallowfullscreenAttr)) {
> 
> GTK does not like it, unified build issue maybe, HTMLNames.h missing
> probably.

Good point; will add. 

> > LayoutTests/http/tests/fullscreen/fullscreen-feature-policy.html:55
> > +    <iframe allow="fullscreen *" data-enabled="true" src="http://localhost:8000/resources/pointer-lock/inner-iframe.html"></iframe>
> 
> Maybe add a test like allow="fullscreen http://localhost..."?

Sure! It’s super easy to add new tests this way. 

> Also, there are probably WPT tests that are testing this but there is no
> rebasing.
> Are there some WPT test we should import?

I checked in wpt/feature-policy, but it looks like those depend on a DOM-exposed mechanism for querying feature policies that we haven’t yet implemented, and wpt/fullscreen didn’t include any of these checks. I didn’t think to check wpt/.../the-iframe-element/.
Comment 6 Jer Noble 2020-01-26 08:39:30 PST
(In reply to youenn fablet from comment #4)
> Looking at WPT, I see
> LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/
> the-iframe-element/iframe-allow.html and
> LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/
> the-iframe-element/iframe-allowfullscreen.html.
> 
> But it seems they fail since they test document.fullscreenEnabled.
> It would be nice to add support for it along
> document.webkitFullscreenEnabled.

We are holding off unprefixing the Fullscreen APIs till we fully implement the current spec. This feature policy work is some of that, but the largest remaining work is layout and stacking context changes.
Comment 7 Jer Noble 2020-01-26 09:46:02 PST
Created attachment 388804 [details]
Patch for landing
Comment 8 Jer Noble 2020-01-26 10:11:16 PST
Created attachment 388805 [details]
Patch for landing
Comment 9 Jer Noble 2020-01-26 11:56:20 PST
Created attachment 388810 [details]
Patch for landing
Comment 10 Jer Noble 2020-01-27 08:27:52 PST
Created attachment 388863 [details]
Patch for landing
Comment 11 WebKit Commit Bot 2020-01-27 12:54:59 PST
Comment on attachment 388863 [details]
Patch for landing

Clearing flags on attachment: 388863

Committed r255162: <https://trac.webkit.org/changeset/255162>
Comment 12 WebKit Commit Bot 2020-01-27 12:55:01 PST
All reviewed patches have been landed.  Closing bug.