WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
155141
Add separate WK and WK2 preferences for requiring user gestures for video media, distinct from user gestures for media generally
https://bugs.webkit.org/show_bug.cgi?id=155141
Summary
Add separate WK and WK2 preferences for requiring user gestures for video med...
Jer Noble
Reported
2016-03-07 15:13:50 PST
Add separate WK and WK2 preferences for requiring user gestures for video media, distinct from user gestures for media generally
Attachments
Patch
(47.12 KB, patch)
2016-03-07 15:25 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch
(46.53 KB, patch)
2016-03-08 10:43 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch
(11.13 KB, patch)
2016-03-08 22:42 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch
(53.50 KB, patch)
2016-03-08 22:48 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch for EWS
(59.22 KB, patch)
2016-03-09 08:52 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch
(35.17 KB, patch)
2016-03-09 14:20 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch
(61.49 KB, patch)
2016-03-09 14:36 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch
(76.85 KB, patch)
2016-03-10 12:28 PST
,
Jer Noble
bdakin
: review+
Details
Formatted Diff
Diff
Show Obsolete
(7)
View All
Add attachment
proposed patch, testcase, etc.
Jer Noble
Comment 1
2016-03-07 15:25:35 PST
Created
attachment 273227
[details]
Patch
Eric Carlson
Comment 2
2016-03-07 18:36:54 PST
Comment on
attachment 273227
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=273227&action=review
> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:3766 > +// ASSERT(obscuredInsets.top >= 0); > +// ASSERT(obscuredInsets.left >= 0); > +// ASSERT(obscuredInsets.bottom >= 0); > +// ASSERT(obscuredInsets.right >= 0);
Oops!
Jer Noble
Comment 3
2016-03-08 10:43:01 PST
Created
attachment 273305
[details]
Patch
Jer Noble
Comment 4
2016-03-08 22:42:34 PST
Created
attachment 273397
[details]
Patch Fixed some broken layout tests, and added a TestWebKitAPI test to ensure these new preferences don't break clients of our existing APIs.
Jer Noble
Comment 5
2016-03-08 22:48:29 PST
Created
attachment 273398
[details]
Patch
Anders Carlsson
Comment 6
2016-03-09 08:00:21 PST
Comment on
attachment 273398
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=273398&action=review
> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:65 > +@property (nonatomic) BOOL allowsInlineMediaPlayback; > +@property (nonatomic) BOOL requiresUserActionForMediaPlayback;
If this is SPI it needs to be prefixed with _.
Eric Carlson
Comment 7
2016-03-09 08:10:27 PST
Comment on
attachment 273398
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=273398&action=review
> Tools/ChangeLog:10 > + * TestWebKitAPI/Tests/WebKit/ios/video-with-audio.html: > + * TestWebKitAPI/Tests/WebKit/ios/video-without-audio.html:
Should these still be in the ios directory?
> Tools/ChangeLog:32 > +2016-03-07 Jer Noble <
jer.noble@apple.com
> > + > + Add separate WK and WK2 preferences for requiring user gestures for video media, distinct from user gestures for media generally > +
https://bugs.webkit.org/show_bug.cgi?id=155141
> + > + Reviewed by NOBODY (OOPS!). > + > + Set the default values for media preferences unconditionally, not just on PLATFORM(IOS). Set "video requires user gesture" > + to sane defaults in addition to "audio requires user gesture" and (in the case of DumpREnderTree) instead of "media requires user gesture". > + > + * DumpRenderTree/mac/DumpRenderTree.mm: > + (resetWebPreferencesToConsistentValues): > + * TestWebKitAPI/Tests/WebKit2Cocoa/Coding.mm: > + (TEST):
Double entry.
> Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:331 > + CD47E7971C8F6FF6004BCFDC /* RequireUserGestureForPlayback.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD47E7961C8F6FF6004BCFDC /* RequireUserGestureForPlayback.mm */; };
It looks like you forgot to add this new test to the repository.
Jer Noble
Comment 8
2016-03-09 08:50:17 PST
Comment on
attachment 273398
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=273398&action=review
>> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:65 >> +@property (nonatomic) BOOL requiresUserActionForMediaPlayback; > > If this is SPI it needs to be prefixed with _.
They're not really SPI, in that they exist as API for TARGET_OS_IPHONE. I was trying to avoid modifying the WKWebViewConfiguration API (to remove the TARGET_OS_IPHONE conditional), which is why they're here. Should I add a note saying so, just remove the conditional in the public header, or prefix the !TARGET_OS_IPHONE properties and add a bunch of #if TARGET_OS_IPHOSE conditionals where they're accessed?
Jer Noble
Comment 9
2016-03-09 08:52:52 PST
Created
attachment 273432
[details]
Patch for EWS
Jer Noble
Comment 10
2016-03-09 14:20:28 PST
Created
attachment 273478
[details]
Patch Removed the non-underscore-prefixed SPI properties from WKWebViewConfigurationPrivate.h and replaced them with nothing.
Jer Noble
Comment 11
2016-03-09 14:36:19 PST
Created
attachment 273484
[details]
Patch
Jer Noble
Comment 12
2016-03-10 12:28:39 PST
Created
attachment 273600
[details]
Patch
Eric Carlson
Comment 13
2016-03-10 12:38:46 PST
Comment on
attachment 273600
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=273600&action=review
> Tools/ChangeLog:9 > + to sane defaults in addition to "audio requires user gesture" and (in the case of DumpREnderTree) instead of "media requires user gesture".
Nit: DumpREnderTree
Eric Carlson
Comment 14
2016-03-10 12:50:52 PST
Comment on
attachment 273600
[details]
Patch These changes look good to me, but a WK2 reviewer should give it the final nod.
Jer Noble
Comment 15
2016-03-10 13:00:47 PST
The gtk-wk2 failure is unrelated; the mac build failures are due to changing Settings.in and not having the derived InternalSettingsGenerated.idl get updated by DerivedSources.make. A clean build will solve that build issue.
Beth Dakin
Comment 16
2016-03-10 13:28:23 PST
Comment on
attachment 273600
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=273600&action=review
r+ for WK2
> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:404 > +#endif
You should add a comment after the #endif to say what the #if was. That will make this more readable.
> Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm:-110 > -#endif
This might also benefit from a comment for what the #if was.
Jer Noble
Comment 17
2016-03-10 13:35:03 PST
Committed
r197953
: <
http://trac.webkit.org/changeset/197953
>
Simon Fraser (smfr)
Comment 18
2016-03-10 18:39:24 PST
This broke windows:
https://build.webkit.org/builders/Apple%20Win%20Debug%20%28Build%29/builds/93666/steps/compile-webkit/logs/stdio
C:\cygwin\home\buildbot\slave\win-debug\build\Source\WebKit\win\WebView.cpp(5308): error C2039: 'setRequiresUserGestureForVideoPlayback': is not a member of 'WebCore::Settings' [C:\cygwin\home\buildbot\slave\win-debug\build\WebKitBuild\Debug\Source\WebKit\WebKit.vcxproj]
Simon Fraser (smfr)
Comment 19
2016-03-10 18:40:27 PST
The test is also crashing in debug:
https://build.webkit.org/results/Apple%20Yosemite%20Debug%20WK2%20(Tests)/r197955%20(10663)/results.html
Jer Noble
Comment 20
2016-03-10 20:12:10 PST
On it.
Jer Noble
Comment 21
2016-03-10 20:17:00 PST
Committed build-fix,
r197988
: <
http://trac.webkit.org/changeset/197988
>
Jer Noble
Comment 22
2016-03-10 20:19:13 PST
And the crash is the same as <
https://bugs.webkit.org/show_bug.cgi?id=155209
>, which I'm about to land a fix for.
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