Title: [184404] trunk/Source
Revision
184404
Author
[email protected]
Date
2015-05-15 12:12:58 -0700 (Fri, 15 May 2015)

Log Message

Limit alternate fullscreen with linked on or after.
https://bugs.webkit.org/show_bug.cgi?id=144894

Patch by Jeremy Jones <[email protected]> on 2015-05-15
Reviewed by Dean Jackson.

Source/WebCore:

* platform/ios/WebCoreSystemInterfaceIOS.h: add new wkIOSSystemVersion

Source/WebKit/mac:

* WebView/WebView.mm:
(shouldAllowAlternateFullscreen): Added.
(-[WebView _preferencesChanged:]):

Source/WebKit2:

* UIProcess/API/Cocoa/WKWebView.mm:
(shouldAllowAlternateFullscreen): Added.
(-[WKWebView initWithFrame:configuration:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (184403 => 184404)


--- trunk/Source/WebCore/ChangeLog	2015-05-15 19:07:28 UTC (rev 184403)
+++ trunk/Source/WebCore/ChangeLog	2015-05-15 19:12:58 UTC (rev 184404)
@@ -1,3 +1,12 @@
+2015-05-15  Jeremy Jones  <[email protected]>
+
+        Limit alternate fullscreen with linked on or after.
+        https://bugs.webkit.org/show_bug.cgi?id=144894
+
+        Reviewed by Dean Jackson.
+
+        * platform/ios/WebCoreSystemInterfaceIOS.h: add new wkIOSSystemVersion
+
 2015-05-15  Roger Fong  <[email protected]>
 
         Unreviewed. Revert part of r184361.

Modified: trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h (184403 => 184404)


--- trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h	2015-05-15 19:07:28 UTC (rev 184403)
+++ trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h	2015-05-15 19:12:58 UTC (rev 184404)
@@ -33,6 +33,9 @@
     wkIOSSystemVersion_4_2 = __IPHONE_4_2,
     wkIOSSystemVersion_5_0 = __IPHONE_5_0,
     wkIOSSystemVersion_6_0 = __IPHONE_6_0,
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000
+    wkIOSSystemVersion_9_0 = __IPHONE_9_0,
+#endif
 } wkIOSSystemVersion;
 
 bool iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion);

Modified: trunk/Source/WebKit/mac/ChangeLog (184403 => 184404)


--- trunk/Source/WebKit/mac/ChangeLog	2015-05-15 19:07:28 UTC (rev 184403)
+++ trunk/Source/WebKit/mac/ChangeLog	2015-05-15 19:12:58 UTC (rev 184404)
@@ -1,3 +1,14 @@
+2015-05-15  Jeremy Jones  <[email protected]>
+
+        Limit alternate fullscreen with linked on or after.
+        https://bugs.webkit.org/show_bug.cgi?id=144894
+
+        Reviewed by Dean Jackson.
+
+        * WebView/WebView.mm:
+        (shouldAllowAlternateFullscreen): Added.
+        (-[WebView _preferencesChanged:]):
+
 2015-05-12  Simon Fraser  <[email protected]>
 
         Turn antialiased font dilation off by default

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (184403 => 184404)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2015-05-15 19:07:28 UTC (rev 184403)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2015-05-15 19:12:58 UTC (rev 184404)
@@ -855,6 +855,16 @@
     return shouldAllowDisplayAndRunningOfInsecureContent;
 }
 
+static bool shouldAllowAlternateFullscreen()
+{
+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000
+    static bool shouldAllowAlternateFullscreen = iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_9_0);
+    return shouldAllowAlternateFullscreen;
+#else
+    return false;
+#endif
+}
+
 #if ENABLE(GAMEPAD)
 static void WebKitInitializeGamepadProviderIfNecessary()
 {
@@ -2298,7 +2308,7 @@
 
     settings.setMediaPlaybackRequiresUserGesture([preferences mediaPlaybackRequiresUserGesture]);
     settings.setMediaPlaybackAllowsInline([preferences mediaPlaybackAllowsInline]);
-    settings.setAllowsAlternateFullscreen([preferences allowsAlternateFullscreen]);
+    settings.setAllowsAlternateFullscreen([preferences allowsAlternateFullscreen] && shouldAllowAlternateFullscreen());
     settings.setSuppressesIncrementalRendering([preferences suppressesIncrementalRendering]);
     settings.setBackspaceKeyNavigationEnabled([preferences backspaceKeyNavigationEnabled]);
     settings.setWantsBalancedSetDefersLoadingBehavior([preferences wantsBalancedSetDefersLoadingBehavior]);

Modified: trunk/Source/WebKit2/ChangeLog (184403 => 184404)


--- trunk/Source/WebKit2/ChangeLog	2015-05-15 19:07:28 UTC (rev 184403)
+++ trunk/Source/WebKit2/ChangeLog	2015-05-15 19:12:58 UTC (rev 184404)
@@ -1,3 +1,14 @@
+2015-05-15  Jeremy Jones  <[email protected]>
+
+        Limit alternate fullscreen with linked on or after.
+        https://bugs.webkit.org/show_bug.cgi?id=144894
+
+        Reviewed by Dean Jackson.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (shouldAllowAlternateFullscreen): Added.
+        (-[WKWebView initWithFrame:configuration:]):
+
 2015-05-15  Chris Dumez  <[email protected]>
 
         [WK2][Cocoa] Back swipe tab snapshot takes a long time to be removed on bing.com

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (184403 => 184404)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2015-05-15 19:07:28 UTC (rev 184403)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2015-05-15 19:12:58 UTC (rev 184404)
@@ -79,6 +79,7 @@
 #import <_javascript_Core/JSContext.h>
 #import <_javascript_Core/JSValue.h>
 #import <WebCore/IOSurface.h>
+#import <WebCore/WebCoreSystemInterface.h>
 #import <wtf/HashMap.h>
 #import <wtf/MathExtras.h>
 #import <wtf/NeverDestroyed.h>
@@ -259,8 +260,18 @@
 #endif
 }
 
+static bool shouldAllowAlternateFullscreen()
+{
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000
+    static bool shouldAllowAlternateFullscreen = iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_9_0);
+    return shouldAllowAlternateFullscreen;
+#else
+    return false;
 #endif
+}
 
+#endif
+
 - (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration
 {
     if (!(self = [super initWithFrame:frame]))
@@ -308,7 +319,7 @@
 
 #if PLATFORM(IOS)
     webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::mediaPlaybackAllowsInlineKey(), WebKit::WebPreferencesStore::Value(!![_configuration allowsInlineMediaPlayback]));
-    webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::allowsAlternateFullscreenKey(), WebKit::WebPreferencesStore::Value(!![_configuration _allowsAlternateFullscreen]));
+    webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::allowsAlternateFullscreenKey(), WebKit::WebPreferencesStore::Value(!![_configuration _allowsAlternateFullscreen] && shouldAllowAlternateFullscreen()));
     webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::mediaPlaybackRequiresUserGestureKey(), WebKit::WebPreferencesStore::Value(!![_configuration mediaPlaybackRequiresUserAction]));
     webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::mediaPlaybackAllowsAirPlayKey(), WebKit::WebPreferencesStore::Value(!![_configuration mediaPlaybackAllowsAirPlay]));
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to