Fix the 32-bit Mac build after:
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Aug 2016 15:55:10 +0000 (15:55 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Aug 2016 15:55:10 +0000 (15:55 +0000)
Add WK2 ExperimentalFeature support to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=160788

Reviewed by NOBODY (OOPS!).

Sprinkle "#if WK_API_ENABLED"s liberally.

* MiniBrowser/mac/AppDelegate.m:
(defaultConfiguration):
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):

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

Tools/ChangeLog
Tools/MiniBrowser/mac/AppDelegate.m
Tools/MiniBrowser/mac/SettingsController.m

index aae9969..11fd7a2 100644 (file)
@@ -1,3 +1,19 @@
+2016-08-12  Brady Eidson  <beidson@apple.com>
+
+        Fix the 32-bit Mac build after:
+        Add WK2 ExperimentalFeature support to MiniBrowser
+        https://bugs.webkit.org/show_bug.cgi?id=160788
+
+        Unreviewed.
+
+        Sprinkle "#if WK_API_ENABLED"s liberally.
+        
+        * MiniBrowser/mac/AppDelegate.m:
+        (defaultConfiguration):
+        * MiniBrowser/mac/SettingsController.m:
+        (-[SettingsController _populateMenu]):
+        (-[SettingsController validateMenuItem:]):
+
 2016-08-12  Philippe Normand  <pnormand@igalia.com>
 
         [GStreamer][OWR] Video rendering fixes
index 3bf75ec..95a576a 100644 (file)
 #import <WebKit/WKWebViewConfigurationPrivate.h>
 #import <WebKit/WKWebsiteDataStorePrivate.h>
 #import <WebKit/WebKit.h>
-#import <WebKit/_WKExperimentalFeature.h>
 #import <WebKit/_WKProcessPoolConfiguration.h>
 #import <WebKit/_WKUserContentExtensionStore.h>
 
+#if WK_API_ENABLED
+#import <WebKit/_WKExperimentalFeature.h>
+#endif
+
 enum {
     WebKit1NewWindowTag = 1,
     WebKit2NewWindowTag = 2
@@ -83,11 +86,13 @@ static WKWebViewConfiguration *defaultConfiguration()
             [singleProcessConfiguration release];
         }
 
+#if WK_API_ENABLED
         NSArray<_WKExperimentalFeature *> *features = [WKPreferences _experimentalFeatures];
         for (_WKExperimentalFeature *feature in features) {
             BOOL enabled = [[NSUserDefaults standardUserDefaults] boolForKey:feature.key];
             [configuration.preferences _setEnabled:enabled forFeature:feature];
         }
+#endif
     }
 
     configuration.suppressesIncrementalRendering = [SettingsController shared].incrementalRenderingSuppressed;
index 5d38aea..0cf7cb0 100644 (file)
 #import "AppDelegate.h"
 #import "BrowserWindowController.h"
 #import <WebKit/WKPreferencesPrivate.h>
+
+#if WK_API_ENABLED
 #import <WebKit/_WKExperimentalFeature.h>
+#endif
 
 static NSString * const defaultURL = @"http://www.webkit.org/";
 static NSString * const DefaultURLPreferenceKey = @"DefaultURL";
@@ -58,7 +61,9 @@ static NSString * const PerWindowWebProcessesDisabledKey = @"PerWindowWebProcess
 typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) {
     NonFastScrollableRegionOverlayTag = 100,
     WheelEventHandlerRegionOverlayTag,
+#if WK_API_ENABLED
     ExperimentalFeatureTag,
+#endif
 };
 
 @implementation SettingsController
@@ -143,6 +148,7 @@ typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) {
     [_menu addItem:debugOverlaysSubmenuItem];
     [debugOverlaysSubmenuItem release];
 
+#if WK_API_ENABLED
     NSMenuItem *experimentalFeaturesSubmenuItem = [[NSMenuItem alloc] initWithTitle:@"Experimental Features" action:nil keyEquivalent:@""];
     NSMenu *experimentalFeaturesMenu = [[NSMenu alloc] initWithTitle:@"Experimental Features"];
     [experimentalFeaturesSubmenuItem setSubmenu:experimentalFeaturesMenu];
@@ -160,6 +166,7 @@ typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) {
 
     [_menu addItem:experimentalFeaturesSubmenuItem];
     [experimentalFeaturesSubmenuItem release];
+#endif // WK_API_ENABLED
 
     [self _addHeaderWithTitle:@"WebKit1-only Settings"];
     [self _addItemWithTitle:@"Enable Subpixel CSSOM Metrics" action:@selector(toggleEnableSubPixelCSSOMMetrics:) indented:YES];
@@ -200,10 +207,12 @@ typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) {
     else if (action == @selector(toggleDebugOverlay:))
         [menuItem setState:[self debugOverlayVisible:menuItem] ? NSOnState : NSOffState];
 
+#if WK_API_ENABLED
     if (menuItem.tag == ExperimentalFeatureTag) {
         _WKExperimentalFeature *feature = menuItem.representedObject;
         [menuItem setState:[defaultPreferences() _isEnabledForFeature:feature] ? NSOnState : NSOffState];
     }
+#endif
 
     return YES;
 }
@@ -395,6 +404,7 @@ typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) {
         [self _toggleBooleanDefault:preferenceKey];
 }
 
+#if WK_API_ENABLED
 - (void)toggleExperimentalFeature:(id)sender
 {
     _WKExperimentalFeature *feature = ((NSMenuItem *)sender).representedObject;
@@ -405,6 +415,7 @@ typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) {
 
     [[NSUserDefaults standardUserDefaults] setBool:!currentlyEnabled forKey:feature.key];
 }
+#endif
 
 - (BOOL)debugOverlayVisible:(NSMenuItem *)menuItem
 {