Bug 183045 - Expose still more WKPreferences SPI to match C SPI
Summary: Expose still more WKPreferences SPI to match C SPI
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jeff Miller
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-02-22 10:38 PST by Jeff Miller
Modified: 2018-03-05 15:20 PST (History)
6 users (show)

See Also:


Attachments
Patch (13.29 KB, patch)
2018-02-22 16:58 PST, Jeff Miller
no flags Details | Formatted Diff | Diff
Patch (10.44 KB, patch)
2018-02-23 10:09 PST, Jeff Miller
achristensen: review+
commit-queue: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Miller 2018-02-22 10:38:49 PST
Add the following properties to the WKPreferences SPI:

_allowsInlineMediaPlayback
_applePayEnabled
_avFoundationNSURLSessionEnabled
_dnsPrefetchingEnabled
_inlineMediaPlaybackRequiresPlaysInlineAttribute
_invisibleMediaAutoplayNotPermitted
_legacyEncryptedMediaAPIEnabled
_lowPowerVideoAudioBufferSizeEnabled
_mainContentUserGestureOverrideEnabled
_mediaStreamEnabled
_needsStorageAccessFromFileURLsQuirk
_pdfPluginEnabled
_requiresUserActionForAudioPlayback
_requiresUserActionForVideoPlayback
_serviceControlsEnabled
_showsToolTipOverTruncatedText
_textAreasAreResizable
_useGiantTiles
_wantsBalancedSetDefersLoadingBehavior
_webAudioEnabled

Some of these are exposed by the WKPreferencesRef C SPI, but some (like _lowPowerVideoAudioBufferSizeEnabled) are not and are being implicitly set by values in Safari's Defaults.plist. When using WKWebView, this will no longer work since WebKit won't read preferences from Safari's defaults, so they need to be exposed via WKPreferences.
Comment 1 Radar WebKit Bug Importer 2018-02-22 11:26:54 PST
<rdar://problem/37795169>
Comment 2 Jeff Miller 2018-02-22 16:29:45 PST
Correction, change _requiresUserActionForAudioPlayback to _requiresUserGestureForAudioPlayback and _requiresUserActionForVideoPlayback to _requiresUserGestureForVideoPlayback.
Comment 3 Jeff Miller 2018-02-22 16:58:21 PST
Created attachment 334486 [details]
Patch
Comment 4 Alex Christensen 2018-02-23 09:32:43 PST
Comment on attachment 334486 [details]
Patch

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

> Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm:1091
> +    WebCore::DeprecatedGlobalSettings::setLowPowerVideoAudioBufferSizeEnabled(enabled);

This is probably setting a bool in the wrong process.

> Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h:166
> +@property (nonatomic, setter=_setAVFoundationNSURLSessionEnabled:) BOOL _avFoundationNSURLSessionEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));

This should always be enabled.
Comment 5 Jeff Miller 2018-02-23 09:36:43 PST
(In reply to Alex Christensen from comment #4)
> Comment on attachment 334486 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=334486&action=review
> 
> > Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm:1091
> > +    WebCore::DeprecatedGlobalSettings::setLowPowerVideoAudioBufferSizeEnabled(enabled);
> 
> This is probably setting a bool in the wrong process.

Good point. I don't think we can easily change this from the UI process. I'll remove this and talk to Jer about what he wants to do, e.g. maybe this deprecated setting should default to true anyway.

> 
> > Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h:166
> > +@property (nonatomic, setter=_setAVFoundationNSURLSessionEnabled:) BOOL _avFoundationNSURLSessionEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA));
> 
> This should always be enabled.

OK, I'll remove this as well.
Comment 6 Jeff Miller 2018-02-23 10:09:31 PST
Created attachment 334537 [details]
Patch
Comment 7 WebKit Commit Bot 2018-03-05 13:38:32 PST
Comment on attachment 334537 [details]
Patch

Rejecting attachment 334537 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 334537, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
rdparty/autoinstalled/mechanize/_urllib2_fork.py", line 332, in _call_chain
    result = func(*args)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1170, in https_open
    return self.do_open(conn_factory, req)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1118, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 60] Operation timed out>

Full output: http://webkit-queues.webkit.org/results/6816090
Comment 8 Jeff Miller 2018-03-05 15:20:51 PST
Committed <https://trac.webkit.org/changeset/229294/webkit>.