Title: [219066] trunk/Source/WebKit/mac
Revision
219066
Author
[email protected]
Date
2017-07-03 02:00:49 -0700 (Mon, 03 Jul 2017)

Log Message

Expose WebPreferences for viewport-fit and constant() properties
https://bugs.webkit.org/show_bug.cgi?id=174072
<rdar://problem/33096639>

Reviewed by Ryosuke Niwa.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences viewportFitEnabled]):
(-[WebPreferences setViewportFitEnabled:]):
(-[WebPreferences constantPropertiesEnabled]):
(-[WebPreferences setConstantPropertiesEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (219065 => 219066)


--- trunk/Source/WebKit/mac/ChangeLog	2017-07-03 08:42:59 UTC (rev 219065)
+++ trunk/Source/WebKit/mac/ChangeLog	2017-07-03 09:00:49 UTC (rev 219066)
@@ -1,3 +1,21 @@
+2017-07-03  Tim Horton  <[email protected]>
+
+        Expose WebPreferences for viewport-fit and constant() properties
+        https://bugs.webkit.org/show_bug.cgi?id=174072
+        <rdar://problem/33096639>
+
+        Reviewed by Ryosuke Niwa.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (-[WebPreferences viewportFitEnabled]):
+        (-[WebPreferences setViewportFitEnabled:]):
+        (-[WebPreferences constantPropertiesEnabled]):
+        (-[WebPreferences setConstantPropertiesEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2017-07-01  Tim Horton  <[email protected]>
 
         Expose viewport-fit value to UIKit via viewport arguments dictionary

Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (219065 => 219066)


--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2017-07-03 08:42:59 UTC (rev 219065)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2017-07-03 09:00:49 UTC (rev 219066)
@@ -187,6 +187,8 @@
 #define WebKitCredentialManagementEnabledPreferenceKey @"WebKitCredentialManagementEnabled"
 #define WebKitMediaUserGestureInheritsFromDocument @"WebKitMediaUserGestureInheritsFromDocument"
 #define WebKitIsSecureContextAttributeEnabledPreferenceKey @"WebKitIsSecureContextAttributeEnabled"
+#define WebKitViewportFitEnabledPreferenceKey @"WebKitViewportFitEnabled"
+#define WebKitConstantPropertiesEnabledPreferenceKey @"WebKitConstantPropertiesEnabled"
 
 #if !TARGET_OS_IPHONE
 // These are private both because callers should be using the cover methods and because the

Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (219065 => 219066)


--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2017-07-03 08:42:59 UTC (rev 219065)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2017-07-03 09:00:49 UTC (rev 219066)
@@ -675,6 +675,8 @@
 #else
         @YES, WebKitLegacyEncryptedMediaAPIEnabledKey,
 #endif
+        @YES, WebKitViewportFitEnabledPreferenceKey,
+        @YES, WebKitConstantPropertiesEnabledPreferenceKey,
         (NSString *)Settings::defaultMediaContentTypesRequiringHardwareSupport(), WebKitMediaContentTypesRequiringHardwareSupportPreferenceKey,
         nil];
 
@@ -3152,6 +3154,26 @@
     [self _setBoolValue:flag forKey:WebKitLegacyEncryptedMediaAPIEnabledKey];
 }
 
+- (BOOL)viewportFitEnabled
+{
+    return [self _boolValueForKey:WebKitViewportFitEnabledPreferenceKey];
+}
+
+- (void)setViewportFitEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitViewportFitEnabledPreferenceKey];
+}
+
+- (BOOL)constantPropertiesEnabled
+{
+    return [self _boolValueForKey:WebKitConstantPropertiesEnabledPreferenceKey];
+}
+
+- (void)setConstantPropertiesEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitConstantPropertiesEnabledPreferenceKey];
+}
+
 @end
 
 @implementation WebPreferences (WebInternal)

Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (219065 => 219066)


--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2017-07-03 08:42:59 UTC (rev 219065)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2017-07-03 09:00:49 UTC (rev 219066)
@@ -578,6 +578,8 @@
 @property (nonatomic) BOOL mediaUserGestureInheritsFromDocument;
 @property (nonatomic) BOOL isSecureContextAttributeEnabled;
 @property (nonatomic) BOOL legacyEncryptedMediaAPIEnabled;
+@property (nonatomic) BOOL viewportFitEnabled;
+@property (nonatomic) BOOL constantPropertiesEnabled;
 
 #if TARGET_OS_IPHONE
 @property (nonatomic) BOOL quickLookDocumentSavingEnabled;

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (219065 => 219066)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2017-07-03 08:42:59 UTC (rev 219065)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2017-07-03 09:00:49 UTC (rev 219066)
@@ -2986,6 +2986,9 @@
 
     settings.setResourceLoadStatisticsEnabled([preferences resourceLoadStatisticsEnabled]);
 
+    settings.setViewportFitEnabled([preferences viewportFitEnabled]);
+    settings.setConstantPropertiesEnabled([preferences constantPropertiesEnabled]);
+
 #if ENABLE(GAMEPAD)
     RuntimeEnabledFeatures::sharedFeatures().setGamepadsEnabled([preferences gamepadsEnabled]);
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to