Changeset 269278 in webkit


Ignore:
Timestamp:
Nov 2, 2020, 4:05:20 PM (5 years ago)
Author:
weinig@apple.com
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.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r269105 r269278  
     12020-11-02  Sam Weinig  <weinig@apple.com>
     2
     3        [Testing] Match WebKitTestRunner and enable all "experimental" features in DumpRenderTree (cocoa)
     4        https://bugs.webkit.org/show_bug.cgi?id=218447
     5
     6        Reviewed by Darin Adler.
     7
     8        * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.mm.erb:
     9        * Scripts/PreferencesTemplates/WebPreferencesInternalFeatures.mm.erb:
     10        * WebView/WebFeature.m:
     11        (-[WebFeature initWithKey:preferencesKey:name:details:defaultValue:hidden:]):
     12        (-[WebFeature initWithKey:name:details:defaultValue:hidden:]): Deleted.
     13        * WebView/WebFeatureInternal.h:
     14        Handle non-standard preference keys by ensure we initialize WebFeatures with the generated
     15        preferenceKey accessor rather than trying to derive it from the key directly.
     16
    1172020-10-28  Sam Weinig  <weinig@apple.com>
    218
  • trunk/Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.mm.erb

    r268719 r269278  
    4242#if <%= @pref.condition %>
    4343<%- end -%>
    44         [[WebFeature alloc] initWithKey:@"<%= @pref.name %>" name:@<%= @pref.humanReadableName %> details:@<%= @pref.humanReadableDescription %> defaultValue:DEFAULT_VALUE_FOR_<%= @pref.name %> hidden:<%= @pref.hidden %>],
     44        [[WebFeature alloc] initWithKey:@"<%= @pref.name %>" preferenceKey:@"<%= @pref.preferenceKey %>" name:@<%= @pref.humanReadableName %> details:@<%= @pref.humanReadableDescription %> defaultValue:DEFAULT_VALUE_FOR_<%= @pref.name %> hidden:<%= @pref.hidden %>],
    4545<%- if @pref.condition -%>
    4646#endif
  • trunk/Source/WebKitLegacy/mac/Scripts/PreferencesTemplates/WebPreferencesInternalFeatures.mm.erb

    r268719 r269278  
    4242#if <%= @pref.condition %>
    4343<%- end -%>
    44         [[WebFeature alloc] initWithKey:@"<%= @pref.name %>" name:@<%= @pref.humanReadableName %> details:@<%= @pref.humanReadableDescription %> defaultValue:DEFAULT_VALUE_FOR_<%= @pref.name %> hidden:<%= @pref.hidden %>],
     44        [[WebFeature alloc] initWithKey:@"<%= @pref.name %>" preferenceKey:@"<%= @pref.preferenceKey %>" name:@<%= @pref.humanReadableName %> details:@<%= @pref.humanReadableDescription %> defaultValue:DEFAULT_VALUE_FOR_<%= @pref.name %> hidden:<%= @pref.hidden %>],
    4545<%- if @pref.condition -%>
    4646#endif
  • trunk/Source/WebKitLegacy/mac/WebView/WebFeature.h

    r267575 r269278  
    3131
    3232@property (nonatomic, readonly, copy) NSString *key;
    33 @property (nonatomic, readonly, copy) NSString *preferencesKey;
     33@property (nonatomic, readonly, copy) NSString *preferenceKey;
    3434@property (nonatomic, readonly, copy) NSString *name;
    3535@property (nonatomic, readonly, copy) NSString *details;
  • trunk/Source/WebKitLegacy/mac/WebView/WebFeature.m

    r267575 r269278  
    2828@implementation WebFeature
    2929
    30 - (instancetype)initWithKey:(NSString *)key name:(NSString *)name details:(NSString *)details defaultValue:(BOOL)defaultValue hidden:(BOOL)hidden
     30- (instancetype)initWithKey:(NSString *)key preferenceKey:(NSString *)preferenceKey name:(NSString *)name details:(NSString *)details defaultValue:(BOOL)defaultValue hidden:(BOOL)hidden
    3131{
    3232    if (!(self = [super init]))
     
    3434
    3535    _key = key;
    36     _preferencesKey = [@"WebKit" stringByAppendingString:_key];
     36    _preferenceKey = preferenceKey;
    3737    _name = name;
    3838    _details = details;
  • trunk/Source/WebKitLegacy/mac/WebView/WebFeatureInternal.h

    r267575 r269278  
    2828@interface WebFeature (Internal)
    2929
    30 - (instancetype)initWithKey:(NSString *)key name:(NSString *)name details:(NSString *)details defaultValue:(BOOL)defaultValue hidden:(BOOL)hidden;
     30- (instancetype)initWithKey:(NSString *)key preferenceKey:(NSString *)preferenceKey name:(NSString *)name details:(NSString *)details defaultValue:(BOOL)defaultValue hidden:(BOOL)hidden;
    3131
    3232@end
  • trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm

    r269105 r269278  
    29692969- (BOOL)_isEnabledForFeature:(WebFeature *)feature
    29702970{
    2971     return [self _boolValueForKey:feature.preferencesKey];
     2971    return [self _boolValueForKey:feature.preferenceKey];
    29722972}
    29732973
    29742974- (void)_setEnabled:(BOOL)value forFeature:(WebFeature *)feature
    29752975{
    2976     [self _setBoolValue:value forKey:feature.preferencesKey];
     2976    [self _setBoolValue:value forKey:feature.preferenceKey];
    29772977}
    29782978
  • trunk/Tools/ChangeLog

    r269269 r269278  
     12020-11-02  Sam Weinig  <weinig@apple.com>
     2
     3        [Testing] Match WebKitTestRunner and enable all "experimental" features in DumpRenderTree (cocoa)
     4        https://bugs.webkit.org/show_bug.cgi?id=218447
     5
     6        Reviewed by Darin Adler.
     7
     8        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
     9        Add missing file, TestOptionsGeneratedWebKitLegacyKeyMapping.cpp.erb.
     10
     11        * DumpRenderTree/mac/DumpRenderTree.mm:
     12        (resetWebPreferencesToConsistentValues):
     13        (enableExperimentalFeatures): Deleted.
     14        Match WebKitTestRunner and enable all experimental features by default. Disable a few of them to
     15        keep the current behavior, but added FIXME to figure out why they are exposed but not enabled. Also
     16        ensure a few preferences that are not experimental features, but were in the enableExperimentalFeatures
     17        function remain set.
     18
    1192020-11-02  David Kilzer  <ddkilzer@apple.com>
    220
  • trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj

    r269105 r269278  
    338338                7C9893DE25433C8700354EBC /* TestOptionsGeneratedWebKitLegacyKeyMapping.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TestOptionsGeneratedWebKitLegacyKeyMapping.cpp; sourceTree = "<group>"; };
    339339                7CBBC3221DDFCF9A00786B9D /* TestOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestOptions.h; sourceTree = "<group>"; };
     340                7CD4A69525507EF8007A5382 /* TestOptionsGeneratedWebKitLegacyKeyMapping.cpp.erb */ = {isa = PBXFileReference; lastKnownFileType = text; path = TestOptionsGeneratedWebKitLegacyKeyMapping.cpp.erb; sourceTree = "<group>"; };
    340341                7CFF9BBD2533BB240008009F /* TestFeatures.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestFeatures.h; sourceTree = "<group>"; };
    341342                7CFF9BBE2533BB240008009F /* TestFeatures.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TestFeatures.cpp; sourceTree = "<group>"; };
     
    772773                        isa = PBXGroup;
    773774                        children = (
     775                                7CD4A69525507EF8007A5382 /* TestOptionsGeneratedWebKitLegacyKeyMapping.cpp.erb */,
    774776                                7C44697F25377A020024290A /* TestOptionsGeneratedKeys.h.erb */,
    775777                        );
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r269236 r269278  
    809809}
    810810
    811 static void enableExperimentalFeatures(WebPreferences* preferences)
    812 {
    813     // FIXME: SpringTimingFunction
    814     [preferences setGamepadsEnabled:YES];
    815     [preferences setHighlightAPIEnabled:YES];
    816     [preferences setLinkPreloadEnabled:YES];
    817     [preferences setMediaPreloadingEnabled:YES];
    818     // FIXME: InputEvents
    819     [preferences setFetchAPIKeepAliveEnabled:YES];
    820     [preferences setWebAnimationsCompositeOperationsEnabled:YES];
    821     [preferences setWebAnimationsMutableTimelinesEnabled:YES];
    822     [preferences setCSSCustomPropertiesAndValuesEnabled:YES];
    823     [preferences setWebGL2Enabled:YES];
    824     [preferences setCacheAPIEnabled:NO];
    825     [preferences setReadableByteStreamAPIEnabled:YES];
    826     [preferences setWritableStreamAPIEnabled:YES];
    827     [preferences setTransformStreamAPIEnabled:YES];
    828     [preferences setEncryptedMediaAPIEnabled:YES];
    829     [preferences setAccessibilityObjectModelEnabled:YES];
    830     [preferences setAriaReflectionEnabled:YES];
    831     [preferences setVisualViewportAPIEnabled:YES];
    832     [preferences setColorFilterEnabled:YES];
    833     [preferences setServerTimingEnabled:YES];
    834     [preferences setIntersectionObserverEnabled:YES];
    835     [preferences setSourceBufferChangeTypeEnabled:YES];
    836     [preferences setCSSOMViewScrollingAPIEnabled:YES];
    837     [preferences setMediaRecorderEnabled:YES];
    838     [preferences setReferrerPolicyAttributeEnabled:YES];
    839     [preferences setLinkPreloadResponsiveImagesEnabled:YES];
    840     [preferences setAspectRatioOfImgFromWidthAndHeightEnabled:YES];
    841     [preferences setCSSOMViewSmoothScrollingEnabled:YES];
    842     [preferences setAudioWorkletEnabled:YES];
    843     [preferences _setSpeechRecognitionEnabled:YES];
    844 
    845     for (WebFeature* feature in [WebPreferences _experimentalFeatures]) {
    846         if ([feature.key isEqual:@"MediaSessionEnabled"])
    847             [preferences _setEnabled:YES forFeature:feature];
    848     }
    849 }
    850 
    851811// Called before each test.
    852812static void resetWebPreferencesToConsistentValues(WebPreferences *preferences)
    853813{
    854     enableExperimentalFeatures(preferences);
     814    for (WebFeature *feature in [WebPreferences _experimentalFeatures])
     815        [preferences _setEnabled:YES forFeature:feature];
     816
     817    // FIXME: These experimental features are currently the only ones not enabled for WebKitLegacy, we
     818    // should either enable them or stop exposing them (as we do with with preferences like HTTP3Enabled).
     819    [preferences _setBoolPreferenceForTestingWithValue:NO forKey:@"WebKitWebAuthenticationEnabled"];
     820    [preferences _setBoolPreferenceForTestingWithValue:NO forKey:@"WebKitIsLoggedInAPIEnabled"];
     821    [preferences _setBoolPreferenceForTestingWithValue:NO forKey:@"WebKitGenericCueAPIEnabled"];
     822    [preferences _setBoolPreferenceForTestingWithValue:NO forKey:@"WebKitLazyImageLoadingEnabled"];
     823    [preferences _setBoolPreferenceForTestingWithValue:NO forKey:@"WebKitLazyIframeLoadingEnabled"];
    855824
    856825    [preferences setStandardFontFamily:@"Times"];
     
    912881#endif
    913882    [preferences setWebAudioEnabled:YES];
    914     [preferences setModernUnprefixedWebAudioEnabled:YES];
    915883    [preferences setMediaSourceEnabled:YES];
    916884    [preferences setSourceBufferChangeTypeEnabled:YES];
    917885    [preferences setDataTransferItemsEnabled:YES];
    918886    [preferences setCustomPasteboardDataEnabled:YES];
    919     [preferences setDialogElementEnabled:YES];
    920     [preferences setWebGL2Enabled:YES];
    921887    [preferences setDownloadAttributeEnabled:YES];
    922888    [preferences setDirectoryUploadEnabled:YES];
    923889    [preferences setHiddenPageDOMTimerThrottlingEnabled:NO];
    924890    [preferences setHiddenPageCSSAnimationSuspensionEnabled:NO];
    925     [preferences setRemotePlaybackEnabled:YES];
    926891    [preferences setMediaDevicesEnabled:YES];
    927892    [preferences setLargeImageAsyncDecodingEnabled:NO];
     
    929894    [preferences setMediaCapabilitiesEnabled:YES];
    930895    [preferences setSelectionAcrossShadowBoundariesEnabled:YES];
    931 
    932896    [preferences setWebSQLEnabled:YES];
    933     [preferences _setMediaRecorderEnabled:YES];
     897    [preferences setEncryptedMediaAPIEnabled:YES];
     898    [preferences setGamepadsEnabled:YES];
     899    [preferences setLinkPreloadEnabled:YES];
     900    [preferences setMediaPreloadingEnabled:YES];
     901    [preferences setColorFilterEnabled:YES];
    934902
    935903    [WebPreferences _clearNetworkLoaderSession];
Note: See TracChangeset for help on using the changeset viewer.