Title: [269278] trunk
Revision
269278
Author
[email protected]
Date
2020-11-02 16:05:20 -0800 (Mon, 02 Nov 2020)

Log Message

[Testing] Match WebKitTestRunner and enable all "experimental" features in DumpRenderTree (cocoa)
https://bugs.webkit.org/show_bug.cgi?id=218447

Reviewed by Darin Adler.

Source/WebKitLegacy/mac:

* Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.mm.erb:
* Scripts/PreferencesTemplates/WebPreferencesInternalFeatures.mm.erb:
* WebView/WebFeature.m:
(-[WebFeature initWithKey:preferencesKey:name:details:defaultValue:hidden:]):
(-[WebFeature initWithKey:name:details:defaultValue:hidden:]): Deleted.
* WebView/WebFeatureInternal.h:
Handle non-standard preference keys by ensure we initialize WebFeatures with the generated
preferenceKey accessor rather than trying to derive it from the key directly.

Tools:

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
Add missing file, TestOptionsGeneratedWebKitLegacyKeyMapping.cpp.erb.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
(enableExperimentalFeatures): Deleted.
Match WebKitTestRunner and enable all experimental features by default. Disable a few of them to
keep the current behavior, but added FIXME to figure out why they are exposed but not enabled. Also
ensure a few preferences that are not experimental features, but were in the enableExperimentalFeatures
function remain set.

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (269277 => 269278)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-11-02 22:41:45 UTC (rev 269277)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-11-03 00:05:20 UTC (rev 269278)
@@ -1,3 +1,19 @@
+2020-11-02  Sam Weinig  <[email protected]>
+
+        [Testing] Match WebKitTestRunner and enable all "experimental" features in DumpRenderTree (cocoa)
+        https://bugs.webkit.org/show_bug.cgi?id=218447
+
+        Reviewed by Darin Adler.
+
+        * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.mm.erb:
+        * Scripts/PreferencesTemplates/WebPreferencesInternalFeatures.mm.erb:
+        * WebView/WebFeature.m:
+        (-[WebFeature initWithKey:preferencesKey:name:details:defaultValue:hidden:]):
+        (-[WebFeature initWithKey:name:details:defaultValue:hidden:]): Deleted.
+        * WebView/WebFeatureInternal.h:
+        Handle non-standard preference keys by ensure we initialize WebFeatures with the generated 
+        preferenceKey accessor rather than trying to derive it from the key directly.
+
 2020-10-28  Sam Weinig  <[email protected]>
 
         [Testing] Remove requirement of adding new SPI for each preference that needs testing

Modified: trunk/Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.mm.erb (269277 => 269278)


--- trunk/Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.mm.erb	2020-11-02 22:41:45 UTC (rev 269277)
+++ trunk/Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.mm.erb	2020-11-03 00:05:20 UTC (rev 269278)
@@ -41,7 +41,7 @@
 <%- if @pref.condition -%>
 #if <%= @pref.condition %>
 <%- end -%>
-        [[WebFeature alloc] initWithKey:@"<%= @pref.name %>" name:@<%= @pref.humanReadableName %> details:@<%= @pref.humanReadableDescription %> defaultValue:DEFAULT_VALUE_FOR_<%= @pref.name %> hidden:<%= @pref.hidden %>],
+        [[WebFeature alloc] initWithKey:@"<%= @pref.name %>" preferenceKey:@"<%= @pref.preferenceKey %>" name:@<%= @pref.humanReadableName %> details:@<%= @pref.humanReadableDescription %> defaultValue:DEFAULT_VALUE_FOR_<%= @pref.name %> hidden:<%= @pref.hidden %>],
 <%- if @pref.condition -%>
 #endif
 <%- end -%>

Modified: trunk/Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesInternalFeatures.mm.erb (269277 => 269278)


--- trunk/Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesInternalFeatures.mm.erb	2020-11-02 22:41:45 UTC (rev 269277)
+++ trunk/Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesInternalFeatures.mm.erb	2020-11-03 00:05:20 UTC (rev 269278)
@@ -41,7 +41,7 @@
 <%- if @pref.condition -%>
 #if <%= @pref.condition %>
 <%- end -%>
-        [[WebFeature alloc] initWithKey:@"<%= @pref.name %>" name:@<%= @pref.humanReadableName %> details:@<%= @pref.humanReadableDescription %> defaultValue:DEFAULT_VALUE_FOR_<%= @pref.name %> hidden:<%= @pref.hidden %>],
+        [[WebFeature alloc] initWithKey:@"<%= @pref.name %>" preferenceKey:@"<%= @pref.preferenceKey %>" name:@<%= @pref.humanReadableName %> details:@<%= @pref.humanReadableDescription %> defaultValue:DEFAULT_VALUE_FOR_<%= @pref.name %> hidden:<%= @pref.hidden %>],
 <%- if @pref.condition -%>
 #endif
 <%- end -%>

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFeature.h (269277 => 269278)


--- trunk/Source/WebKitLegacy/mac/WebView/WebFeature.h	2020-11-02 22:41:45 UTC (rev 269277)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFeature.h	2020-11-03 00:05:20 UTC (rev 269278)
@@ -30,7 +30,7 @@
 @interface WebFeature : NSObject
 
 @property (nonatomic, readonly, copy) NSString *key;
-@property (nonatomic, readonly, copy) NSString *preferencesKey;
+@property (nonatomic, readonly, copy) NSString *preferenceKey;
 @property (nonatomic, readonly, copy) NSString *name;
 @property (nonatomic, readonly, copy) NSString *details;
 @property (nonatomic, readonly) BOOL defaultValue;

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFeature.m (269277 => 269278)


--- trunk/Source/WebKitLegacy/mac/WebView/WebFeature.m	2020-11-02 22:41:45 UTC (rev 269277)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFeature.m	2020-11-03 00:05:20 UTC (rev 269278)
@@ -27,13 +27,13 @@
 
 @implementation WebFeature
 
-- (instancetype)initWithKey:(NSString *)key name:(NSString *)name details:(NSString *)details defaultValue:(BOOL)defaultValue hidden:(BOOL)hidden
+- (instancetype)initWithKey:(NSString *)key preferenceKey:(NSString *)preferenceKey name:(NSString *)name details:(NSString *)details defaultValue:(BOOL)defaultValue hidden:(BOOL)hidden
 {
     if (!(self = [super init]))
         return nil;
 
     _key = key;
-    _preferencesKey = [@"WebKit" stringByAppendingString:_key];
+    _preferenceKey = preferenceKey;
     _name = name;
     _details = details;
     _defaultValue = defaultValue;

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFeatureInternal.h (269277 => 269278)


--- trunk/Source/WebKitLegacy/mac/WebView/WebFeatureInternal.h	2020-11-02 22:41:45 UTC (rev 269277)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFeatureInternal.h	2020-11-03 00:05:20 UTC (rev 269278)
@@ -27,7 +27,7 @@
 
 @interface WebFeature (Internal)
 
-- (instancetype)initWithKey:(NSString *)key name:(NSString *)name details:(NSString *)details defaultValue:(BOOL)defaultValue hidden:(BOOL)hidden;
+- (instancetype)initWithKey:(NSString *)key preferenceKey:(NSString *)preferenceKey name:(NSString *)name details:(NSString *)details defaultValue:(BOOL)defaultValue hidden:(BOOL)hidden;
 
 @end
 

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (269277 => 269278)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2020-11-02 22:41:45 UTC (rev 269277)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2020-11-03 00:05:20 UTC (rev 269278)
@@ -2968,12 +2968,12 @@
 
 - (BOOL)_isEnabledForFeature:(WebFeature *)feature
 {
-    return [self _boolValueForKey:feature.preferencesKey];
+    return [self _boolValueForKey:feature.preferenceKey];
 }
 
 - (void)_setEnabled:(BOOL)value forFeature:(WebFeature *)feature
 {
-    [self _setBoolValue:value forKey:feature.preferencesKey];
+    [self _setBoolValue:value forKey:feature.preferenceKey];
 }
 
 @end

Modified: trunk/Tools/ChangeLog (269277 => 269278)


--- trunk/Tools/ChangeLog	2020-11-02 22:41:45 UTC (rev 269277)
+++ trunk/Tools/ChangeLog	2020-11-03 00:05:20 UTC (rev 269278)
@@ -1,3 +1,21 @@
+2020-11-02  Sam Weinig  <[email protected]>
+
+        [Testing] Match WebKitTestRunner and enable all "experimental" features in DumpRenderTree (cocoa)
+        https://bugs.webkit.org/show_bug.cgi?id=218447
+
+        Reviewed by Darin Adler.
+
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+        Add missing file, TestOptionsGeneratedWebKitLegacyKeyMapping.cpp.erb.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebPreferencesToConsistentValues):
+        (enableExperimentalFeatures): Deleted.
+        Match WebKitTestRunner and enable all experimental features by default. Disable a few of them to 
+        keep the current behavior, but added FIXME to figure out why they are exposed but not enabled. Also 
+        ensure a few preferences that are not experimental features, but were in the enableExperimentalFeatures
+        function remain set.
+
 2020-11-02  David Kilzer  <[email protected]>
 
         Sort Xcode project file

Modified: trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj (269277 => 269278)


--- trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj	2020-11-02 22:41:45 UTC (rev 269277)
+++ trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj	2020-11-03 00:05:20 UTC (rev 269278)
@@ -337,6 +337,7 @@
 		7C44698525377E520024290A /* TestOptionsGeneratedKeys.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestOptionsGeneratedKeys.h; sourceTree = "<group>"; };
 		7C9893DE25433C8700354EBC /* TestOptionsGeneratedWebKitLegacyKeyMapping.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TestOptionsGeneratedWebKitLegacyKeyMapping.cpp; sourceTree = "<group>"; };
 		7CBBC3221DDFCF9A00786B9D /* TestOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestOptions.h; sourceTree = "<group>"; };
+		7CD4A69525507EF8007A5382 /* TestOptionsGeneratedWebKitLegacyKeyMapping.cpp.erb */ = {isa = PBXFileReference; lastKnownFileType = text; path = TestOptionsGeneratedWebKitLegacyKeyMapping.cpp.erb; sourceTree = "<group>"; };
 		7CFF9BBD2533BB240008009F /* TestFeatures.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestFeatures.h; sourceTree = "<group>"; };
 		7CFF9BBE2533BB240008009F /* TestFeatures.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TestFeatures.cpp; sourceTree = "<group>"; };
 		7CFF9BC02533BC160008009F /* TestCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestCommand.h; sourceTree = "<group>"; };
@@ -771,6 +772,7 @@
 		7C44697E25377A020024290A /* PreferencesTemplates */ = {
 			isa = PBXGroup;
 			children = (
+				7CD4A69525507EF8007A5382 /* TestOptionsGeneratedWebKitLegacyKeyMapping.cpp.erb */,
 				7C44697F25377A020024290A /* TestOptionsGeneratedKeys.h.erb */,
 			);
 			path = PreferencesTemplates;

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (269277 => 269278)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2020-11-02 22:41:45 UTC (rev 269277)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2020-11-03 00:05:20 UTC (rev 269278)
@@ -808,51 +808,20 @@
         return [@"~/Library/Application Support/DumpRenderTree" stringByExpandingTildeInPath];
 }
 
-static void enableExperimentalFeatures(WebPreferences* preferences)
-{
-    // FIXME: SpringTimingFunction
-    [preferences setGamepadsEnabled:YES];
-    [preferences setHighlightAPIEnabled:YES];
-    [preferences setLinkPreloadEnabled:YES];
-    [preferences setMediaPreloadingEnabled:YES];
-    // FIXME: InputEvents
-    [preferences setFetchAPIKeepAliveEnabled:YES];
-    [preferences setWebAnimationsCompositeOperationsEnabled:YES];
-    [preferences setWebAnimationsMutableTimelinesEnabled:YES];
-    [preferences setCSSCustomPropertiesAndValuesEnabled:YES];
-    [preferences setWebGL2Enabled:YES];
-    [preferences setCacheAPIEnabled:NO];
-    [preferences setReadableByteStreamAPIEnabled:YES];
-    [preferences setWritableStreamAPIEnabled:YES];
-    [preferences setTransformStreamAPIEnabled:YES];
-    [preferences setEncryptedMediaAPIEnabled:YES];
-    [preferences setAccessibilityObjectModelEnabled:YES];
-    [preferences setAriaReflectionEnabled:YES];
-    [preferences setVisualViewportAPIEnabled:YES];
-    [preferences setColorFilterEnabled:YES];
-    [preferences setServerTimingEnabled:YES];
-    [preferences setIntersectionObserverEnabled:YES];
-    [preferences setSourceBufferChangeTypeEnabled:YES];
-    [preferences setCSSOMViewScrollingAPIEnabled:YES];
-    [preferences setMediaRecorderEnabled:YES];
-    [preferences setReferrerPolicyAttributeEnabled:YES];
-    [preferences setLinkPreloadResponsiveImagesEnabled:YES];
-    [preferences setAspectRatioOfImgFromWidthAndHeightEnabled:YES];
-    [preferences setCSSOMViewSmoothScrollingEnabled:YES];
-    [preferences setAudioWorkletEnabled:YES];
-    [preferences _setSpeechRecognitionEnabled:YES];
-
-    for (WebFeature* feature in [WebPreferences _experimentalFeatures]) {
-        if ([feature.key isEqual:@"MediaSessionEnabled"])
-            [preferences _setEnabled:YES forFeature:feature];
-    }
-}
-
 // Called before each test.
 static void resetWebPreferencesToConsistentValues(WebPreferences *preferences)
 {
-    enableExperimentalFeatures(preferences);
+    for (WebFeature *feature in [WebPreferences _experimentalFeatures])
+        [preferences _setEnabled:YES forFeature:feature];
 
+    // FIXME: These experimental features are currently the only ones not enabled for WebKitLegacy, we
+    // should either enable them or stop exposing them (as we do with with preferences like HTTP3Enabled).
+    [preferences _setBoolPreferenceForTestingWithValue:NO forKey:@"WebKitWebAuthenticationEnabled"];
+    [preferences _setBoolPreferenceForTestingWithValue:NO forKey:@"WebKitIsLoggedInAPIEnabled"];
+    [preferences _setBoolPreferenceForTestingWithValue:NO forKey:@"WebKitGenericCueAPIEnabled"];
+    [preferences _setBoolPreferenceForTestingWithValue:NO forKey:@"WebKitLazyImageLoadingEnabled"];
+    [preferences _setBoolPreferenceForTestingWithValue:NO forKey:@"WebKitLazyIframeLoadingEnabled"];
+
     [preferences setStandardFontFamily:@"Times"];
     [preferences setFixedFontFamily:@"Courier"];
     [preferences setSerifFontFamily:@"Times"];
@@ -911,26 +880,25 @@
     [preferences setMockScrollbarsEnabled:YES];
 #endif
     [preferences setWebAudioEnabled:YES];
-    [preferences setModernUnprefixedWebAudioEnabled:YES];
     [preferences setMediaSourceEnabled:YES];
     [preferences setSourceBufferChangeTypeEnabled:YES];
     [preferences setDataTransferItemsEnabled:YES];
     [preferences setCustomPasteboardDataEnabled:YES];
-    [preferences setDialogElementEnabled:YES];
-    [preferences setWebGL2Enabled:YES];
     [preferences setDownloadAttributeEnabled:YES];
     [preferences setDirectoryUploadEnabled:YES];
     [preferences setHiddenPageDOMTimerThrottlingEnabled:NO];
     [preferences setHiddenPageCSSAnimationSuspensionEnabled:NO];
-    [preferences setRemotePlaybackEnabled:YES];
     [preferences setMediaDevicesEnabled:YES];
     [preferences setLargeImageAsyncDecodingEnabled:NO];
     [preferences setModernMediaControlsEnabled:YES];
     [preferences setMediaCapabilitiesEnabled:YES];
     [preferences setSelectionAcrossShadowBoundariesEnabled:YES];
-
     [preferences setWebSQLEnabled:YES];
-    [preferences _setMediaRecorderEnabled:YES];
+    [preferences setEncryptedMediaAPIEnabled:YES];
+    [preferences setGamepadsEnabled:YES];
+    [preferences setLinkPreloadEnabled:YES];
+    [preferences setMediaPreloadingEnabled:YES];
+    [preferences setColorFilterEnabled:YES];
 
     [WebPreferences _clearNetworkLoaderSession];
     [WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to