Bug 93961 - Automatic features should work in sandboxed iframes if "allow-scripts" flag is set
Summary: Automatic features should work in sandboxed iframes if "allow-scripts" flag i...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: http://dev.w3.org/html5/spec/browsers...
Depends on:
Reported: 2012-08-14 06:17 PDT by Jussi Kukkonen (jku)
Modified: 2012-09-10 07:06 PDT (History)
9 users (show)

See Also:

Patch (10.25 KB, patch)
2012-09-04 00:01 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jussi Kukkonen (jku) 2012-08-14 06:17:19 PDT
Looks like media/no-auto-play-in-sandbox.html test (and the functionality it tests) is wrong.

It expects the media to _not_ autoplay in an iframe with sandbox="allow-scripts allow-same-origin". This seems incorrect as according to spec (both whatwg and w3c working draft) autoplay is restricted by "automatic features browsing context flag" which should not be set if allow-scripts is set.
Comment 2 Chris Dumez 2012-09-03 06:58:44 PDT
It also impacts:

Autofocus should work in a sandboxed iframe that has allow-scripts flag set (according to latest spec).

Manual test:
Comment 3 Chris Dumez 2012-09-04 00:01:42 PDT
Created attachment 161974 [details]

Unfortunately, the present patch removes the test cases that check that autoplay / autofocus are blocked in sandboxed iframes. Those tests are no longer working since they rely on the "allow-scripts" flag to be set in order to work.
It is not easy to automatically test this but I'm open to suggestions on how to better handle this.

I have validated the patch using the LayoutTests added in the patch and the following manual tests:
Comment 4 Eric Seidel (no email) 2012-09-04 00:33:53 PDT
This is for you Adam. :)
Comment 5 Adam Barth 2012-09-04 11:00:40 PDT
Comment on attachment 161974 [details]

Thanks for fixing this.  Yeah, I'm not sure how to test these features anymore...
Comment 6 WebKit Review Bot 2012-09-04 11:57:56 PDT
Comment on attachment 161974 [details]

Clearing flags on attachment: 161974

Committed r127481: <http://trac.webkit.org/changeset/127481>
Comment 7 WebKit Review Bot 2012-09-04 11:58:00 PDT
All reviewed patches have been landed.  Closing bug.