Add a WebKit2 setting to control whether media documents should automatically enter...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Jun 2017 02:39:20 +0000 (02:39 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Jun 2017 02:39:20 +0000 (02:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173503

Patch by Antoine Quint <graouts@apple.com> on 2017-06-16
Reviewed by Tim Horton.

Source/WebCore:

New WebCore setting to specify whether a media document should automatically enter fullscreen.

* page/Settings.in:

Source/WebKit2:

New WebKit2 setting to specify whether a media document should automatically enter fullscreen.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setMediaDocumentEntersFullscreenAutomatically:]):
(-[WKPreferences _mediaDocumentEntersFullscreenAutomatically]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218439 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/Settings.in
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 56678d7..352050e 100644 (file)
@@ -1,3 +1,14 @@
+2017-06-16  Antoine Quint  <graouts@apple.com>
+
+        Add a WebKit2 setting to control whether media documents should automatically enter fullscreen
+        https://bugs.webkit.org/show_bug.cgi?id=173503
+
+        Reviewed by Tim Horton.
+
+        New WebCore setting to specify whether a media document should automatically enter fullscreen.
+
+        * page/Settings.in:
+
 2017-06-16  Jer Noble  <jer.noble@apple.com>
 
         [MSE] Seeking or entering fullscreen can cause extreme CPU usage
index 01b3417..5137300 100644 (file)
@@ -215,6 +215,7 @@ mediaSourceEnabled initial=true, conditional=MEDIA_SOURCE
 allowMultiElementImplicitSubmission initial=false
 
 allowsAirPlayForMediaPlayback initial=true, conditional=WIRELESS_PLAYBACK_TARGET
+mediaDocumentEntersFullscreenAutomatically initial=false
 
 shouldConvertPositionStyleOnCopy initial=false
 
index 48bd036..d7d08bd 100644 (file)
@@ -1,3 +1,20 @@
+2017-06-16  Antoine Quint  <graouts@apple.com>
+
+        Add a WebKit2 setting to control whether media documents should automatically enter fullscreen
+        https://bugs.webkit.org/show_bug.cgi?id=173503
+
+        Reviewed by Tim Horton.
+
+        New WebKit2 setting to specify whether a media document should automatically enter fullscreen.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _setMediaDocumentEntersFullscreenAutomatically:]):
+        (-[WKPreferences _mediaDocumentEntersFullscreenAutomatically]):
+        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2017-06-16  Sam Weinig  <sam@webkit.org>
 
         [WebIDL] Remove custom bindings for HTMLDocument
index 3ef1ed5..9fc5a7b 100644 (file)
     macro(AllowsPictureInPictureMediaPlayback, allowsPictureInPictureMediaPlayback, Bool, bool, DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK, "", "") \
     macro(AllowsAirPlayForMediaPlayback, allowsAirPlayForMediaPlayback, Bool, bool, true, "", "") \
     macro(MediaControlsScaleWithPageZoom, mediaControlsScaleWithPageZoom, Bool, bool, DEFAULT_MEDIA_CONTROLS_SCALE_WITH_PAGE_ZOOM, "", "") \
+    macro(MediaDocumentEntersFullscreenAutomatically, mediaDocumentEntersFullscreenAutomatically, Bool, bool, false, "", "") \
     macro(InspectorStartsAttached, inspectorStartsAttached, Bool, bool, true, "", "") \
     macro(ShowsToolTipOverTruncatedText, showsToolTipOverTruncatedText, Bool, bool, false, "", "") \
     macro(MockScrollbarsEnabled, mockScrollbarsEnabled, Bool, bool, false, "", "") \
index f453b0c..e28a5cf 100644 (file)
@@ -627,6 +627,16 @@ static _WKStorageBlockingPolicy toAPI(WebCore::SecurityOrigin::StorageBlockingPo
     return _preferences->javaScriptCanAccessClipboard();
 }
 
+- (void)_setMediaDocumentEntersFullscreenAutomatically:(BOOL)mediaDocumentEntersFullscreenAutomatically
+{
+    _preferences->setMediaDocumentEntersFullscreenAutomatically(mediaDocumentEntersFullscreenAutomatically);
+}
+
+- (BOOL)_mediaDocumentEntersFullscreenAutomatically
+{
+    return _preferences->mediaDocumentEntersFullscreenAutomatically();
+}
+
 @end
 
 #endif // WK_API_ENABLED
index 1e8c30c..788cf79 100644 (file)
@@ -108,6 +108,8 @@ typedef NS_OPTIONS(NSUInteger, _WKJavaScriptRuntimeFlags) {
 
 @property (nonatomic, setter=_setJavaScriptCanAccessClipboard:) BOOL _javaScriptCanAccessClipboard WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
 
+@property (nonatomic, setter=_setMediaDocumentEntersFullscreenAutomatically:) BOOL _mediaDocumentEntersFullscreenAutomatically WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+
 + (NSArray<_WKExperimentalFeature *> *)_experimentalFeatures WK_API_AVAILABLE(macosx(10.12), ios(10.0));
 - (BOOL)_isEnabledForFeature:(_WKExperimentalFeature *)feature WK_API_AVAILABLE(macosx(10.12), ios(10.0));
 - (void)_setEnabled:(BOOL)value forFeature:(_WKExperimentalFeature *)feature WK_API_AVAILABLE(macosx(10.12), ios(10.0));
index 2eb675d..f30d3b4 100644 (file)
@@ -3384,6 +3384,8 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
     settings.setAnimatedImageAsyncDecodingEnabled(store.getBoolValueForKey(WebPreferencesKey::animatedImageAsyncDecodingEnabledKey()));
     settings.setShouldSuppressKeyboardInputDuringProvisionalNavigation(store.getBoolValueForKey(WebPreferencesKey::shouldSuppressKeyboardInputDuringProvisionalNavigationKey()));
     settings.setMediaContentTypesRequiringHardwareSupport(store.getStringValueForKey(WebPreferencesKey::mediaContentTypesRequiringHardwareSupportKey()));
+
+    settings.setMediaDocumentEntersFullscreenAutomatically(store.getBoolValueForKey(WebPreferencesKey::mediaDocumentEntersFullscreenAutomaticallyKey()));
 }
 
 #if ENABLE(DATA_DETECTION)