WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
156312
[WK2] Add API to WKWebViewConfiguration to control autoplay policy.
https://bugs.webkit.org/show_bug.cgi?id=156312
Summary
[WK2] Add API to WKWebViewConfiguration to control autoplay policy.
Jer Noble
Reported
2016-04-06 14:37:09 PDT
[WK2] Add API to WKWebViewConfiguration to control autoplay policy.
Attachments
Patch
(20.15 KB, patch)
2016-04-12 11:47 PDT
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews105 for mac-yosemite-wk2
(862.46 KB, application/zip)
2016-04-12 12:38 PDT
,
Build Bot
no flags
Details
Archive of layout-test-results from ews121 for ios-simulator-wk2
(823.13 KB, application/zip)
2016-04-12 12:56 PDT
,
Build Bot
no flags
Details
Patch
(20.93 KB, patch)
2016-04-12 13:22 PDT
,
Jer Noble
mitz: review+
buildbot
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from ews121 for ios-simulator-wk2
(822.92 KB, application/zip)
2016-04-12 14:30 PDT
,
Build Bot
no flags
Details
Follow-up patch
(2.46 KB, patch)
2016-05-17 09:10 PDT
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Jer Noble
Comment 1
2016-04-06 14:39:15 PDT
rdar://problem/25584201
Jer Noble
Comment 2
2016-04-12 11:47:14 PDT
Created
attachment 276255
[details]
Patch
WebKit Commit Bot
Comment 3
2016-04-12 11:49:11 PDT
Attachment 276255
[details]
did not pass style-queue: ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h:83: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 1 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 4
2016-04-12 12:38:10 PDT
Comment on
attachment 276255
[details]
Patch
Attachment 276255
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.webkit.org/results/1143307
Number of test failures exceeded the failure limit.
Build Bot
Comment 5
2016-04-12 12:38:13 PDT
Created
attachment 276262
[details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 6
2016-04-12 12:56:14 PDT
Comment on
attachment 276255
[details]
Patch
Attachment 276255
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
http://webkit-queues.webkit.org/results/1143320
New failing tests: http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-video.html http/tests/security/contentSecurityPolicy/audio-redirect-allowed.html http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio.html fast/dom/beforeload/video-before-load.html http/tests/appcache/video.html compositing/layers-inside-overflow-scroll.html http/tests/security/contentSecurityPolicy/video-redirect-blocked.html compositing/video/poster.html imported/blink/compositing/video/video-controls-layer-creation-squashing.html http/tests/misc/empty-urls.html imported/w3c/web-platform-tests/html/dom/interfaces.html http/tests/security/contentSecurityPolicy/video-with-http-url-allowed-by-csp-media-src-star.html fast/dom/beforeload/remove-video-in-beforeload-listener.html http/tests/security/contentSecurityPolicy/video-redirect-allowed.html http/tests/security/contentSecurityPolicy/media-src-blocked.html http/tests/security/contentSecurityPolicy/audio-redirect-blocked.html compositing/video/video-object-position.html http/tests/security/local-video-src-from-remote.html
Build Bot
Comment 7
2016-04-12 12:56:17 PDT
Created
attachment 276264
[details]
Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.10.5
Jer Noble
Comment 8
2016-04-12 13:22:52 PDT
Created
attachment 276268
[details]
Patch
WebKit Commit Bot
Comment 9
2016-04-12 13:23:38 PDT
Attachment 276268
[details]
did not pass style-queue: ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h:83: Place brace on its own line for function definitions. [whitespace/braces] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 10
2016-04-12 14:30:52 PDT
Comment on
attachment 276268
[details]
Patch
Attachment 276268
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
http://webkit-queues.webkit.org/results/1143953
New failing tests: http/tests/security/local-video-src-from-remote.html http/tests/security/contentSecurityPolicy/audio-redirect-allowed.html http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio.html http/tests/appcache/video.html compositing/video/poster.html http/tests/security/contentSecurityPolicy/video-redirect-blocked.html compositing/layers-inside-overflow-scroll.html compositing/video/video-object-position.html http/tests/misc/empty-urls.html imported/w3c/web-platform-tests/html/dom/interfaces.html http/tests/security/contentSecurityPolicy/video-with-http-url-allowed-by-csp-media-src-star.html fast/dom/beforeload/remove-video-in-beforeload-listener.html http/tests/security/contentSecurityPolicy/video-redirect-allowed.html http/tests/security/contentSecurityPolicy/media-src-blocked.html http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-video.html imported/blink/compositing/video/video-controls-layer-creation-squashing.html http/tests/security/contentSecurityPolicy/audio-redirect-blocked.html fast/dom/beforeload/video-before-load.html
Build Bot
Comment 11
2016-04-12 14:30:55 PDT
Created
attachment 276278
[details]
Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.10.5
Anders Carlsson
Comment 12
2016-04-15 17:20:32 PDT
Comment on
attachment 276268
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=276268&action=review
> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h:83 > +typedef NS_OPTIONS(NSUInteger, WKAudiovisualMediaTypes) {
Do we need to call them Audiovisual media types?
Jer Noble
Comment 13
2016-04-15 17:42:55 PDT
(In reply to
comment #12
)
> Comment on
attachment 276268
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=276268&action=review
> > > Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h:83 > > +typedef NS_OPTIONS(NSUInteger, WKAudiovisualMediaTypes) { > > Do we need to call them Audiovisual media types?
"Media" is a heavily overloaded term. I wanted to distinguish them from "media queries" media.
mitz
Comment 14
2016-04-18 23:45:15 PDT
Comment on
attachment 276268
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=276268&action=review
r=me, with concern about binary compatibility
> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:141 > - _requiresUserActionForVideoPlayback = NO; > - _requiresUserActionForAudioPlayback = NO; > + _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAudio;
The change log doesn’t mention it, but this is changing the default behavior, right? It seems risky to do so because existing clients may be relying on the old behavior. Especially since clients that use the old API can’t even sense the new behavior: if they call the old requiresUserActionForMediaPlayback it returns NO, even though audio doesn’t require user action.
> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:587 > + return self.mediaTypesRequiringUserActionForPlayback & WKAudiovisualMediaTypeVideo;
This only works because WKAudiovisualMediaTypeVideo is less than 255. Even though this is unlikely to change, I’d write this either as !!(self.mediaTypesRequiringUserActionForPlayback & WKAudiovisualMediaTypeVideo) or self.mediaTypesRequiringUserActionForPlayback & WKAudiovisualMediaTypeVideo == WKAudiovisualMediaTypeVideo.
> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:600 > + return self.mediaTypesRequiringUserActionForPlayback & WKAudiovisualMediaTypeAudio;
Ditto.
Jer Noble
Comment 15
2016-04-19 13:44:43 PDT
(In reply to
comment #14
)
> Comment on
attachment 276268
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=276268&action=review
> > r=me, with concern about binary compatibility > > > Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:141 > > - _requiresUserActionForVideoPlayback = NO; > > - _requiresUserActionForAudioPlayback = NO; > > + _mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeAudio; > > The change log doesn’t mention it, but this is changing the default > behavior, right? It seems risky to do so because existing clients may be > relying on the old behavior. Especially since clients that use the old API > can’t even sense the new behavior: if they call the old > requiresUserActionForMediaPlayback it returns NO, even though audio doesn’t > require user action.
Yes, this is changing the default behavior. We can (and should!) add a linked-on-or-after check to protect clients who haven't re-compiled with the new API, so that their default behavior stays the same.
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:587 > > + return self.mediaTypesRequiringUserActionForPlayback & WKAudiovisualMediaTypeVideo; > > This only works because WKAudiovisualMediaTypeVideo is less than 255. Even > though this is unlikely to change, I’d write this either as > !!(self.mediaTypesRequiringUserActionForPlayback & > WKAudiovisualMediaTypeVideo) or > self.mediaTypesRequiringUserActionForPlayback & WKAudiovisualMediaTypeVideo > == WKAudiovisualMediaTypeVideo.
Ok.
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:600 > > + return self.mediaTypesRequiringUserActionForPlayback & WKAudiovisualMediaTypeAudio; > > Ditto.
Ok.
Jer Noble
Comment 16
2016-05-16 11:22:31 PDT
Committed
r200951
: <
http://trac.webkit.org/changeset/200951
>
Csaba Osztrogonác
Comment 17
2016-05-17 06:47:16 PDT
(In reply to
comment #16
)
> Committed
r200951
: <
http://trac.webkit.org/changeset/200951
>
FYI: It made all media tests timeout and bots early exit on GTK and EFL ports. ( cc-ing port maintainers )
Jer Noble
Comment 18
2016-05-17 09:04:52 PDT
(In reply to
comment #17
)
> (In reply to
comment #16
) > > Committed
r200951
: <
http://trac.webkit.org/changeset/200951
> > > FYI: It made all media tests timeout and bots early exit on GTK and EFL > ports. > > ( cc-ing port maintainers )
Ah, this was my mistake. I'll take care of it.
Jer Noble
Comment 19
2016-05-17 09:09:59 PDT
Reopening to attach new patch.
Jer Noble
Comment 20
2016-05-17 09:10:03 PDT
Created
attachment 279130
[details]
Follow-up patch
WebKit Commit Bot
Comment 21
2016-05-17 09:39:49 PDT
Comment on
attachment 279130
[details]
Follow-up patch Clearing flags on attachment: 279130 Committed
r201016
: <
http://trac.webkit.org/changeset/201016
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug