Changeset 132309 in webkit


Ignore:
Timestamp:
Oct 23, 2012 10:13:12 PM (12 years ago)
Author:
mitz@apple.com
Message:

Source/WebKit/mac: WebKit/mac part of <rdar://problem/2966974> [mac] Kerning and ligatures are not enabled by default
https://bugs.webkit.org/show_bug.cgi?id=100188

Reviewed by Sam Weinig.

  • WebView/WebView.mm:

(+[WebView initialize]): Added a local variable to hold the standard user defaults. Added
code to register a value of YES for the WebKitKerningAndLigaturesEnabledByDefault user
default. Changed to refer to that default key by name.

Source/WebKit2: WebKit2 part of <rdar://problem/2966974> [mac] Kerning and ligatures are not enabled by default
https://bugs.webkit.org/show_bug.cgi?id=100188

Reviewed by Sam Weinig.

  • UIProcess/mac/WebContextMac.mm:

(WebKit::registerUserDefaultsIfNeeded): Added. Registers a value of YES for the
WebKitKerningAndLigaturesEnabledByDefault user default if it has not been registered yet.
(WebKit::WebContext::platformInitializeWebProcess): Added a call to
registerUserDefaultsIfNeeded, and changed to refer to the defaults key by name.

Tools: Tools changes for <rdar://problem/2966974> [mac] Kerning and ligatures are not enabled by default
https://bugs.webkit.org/show_bug.cgi?id=100188

Reviewed by Sam Weinig.

Disable kerning and ligatures by default when running the tests.

  • DumpRenderTree/mac/DumpRenderTree.mm:

(resetDefaultsToConsistentValues): Set a value of NO for the
WebKitKerningAndLigaturesEnabledByDefault user default.

  • WebKitTestRunner/mac/main.mm:

(main): Register a value of NO for the WebKitKerningAndLigaturesEnabledByDefault user
default.

Location:
trunk
Files:
7 edited

Legend:

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

    r132227 r132309  
     12012-10-23  Dan Bernstein  <mitz@apple.com>
     2
     3        WebKit/mac part of <rdar://problem/2966974> [mac] Kerning and ligatures are not enabled by default
     4        https://bugs.webkit.org/show_bug.cgi?id=100188
     5
     6        Reviewed by Sam Weinig.
     7
     8        * WebView/WebView.mm:
     9        (+[WebView initialize]): Added a local variable to hold the standard user defaults. Added
     10        code to register a value of YES for the WebKitKerningAndLigaturesEnabledByDefault user
     11        default. Changed to refer to that default key by name.
     12
    1132012-10-23  Kenneth Rohde Christiansen  <kenneth@webkit.org>
    214
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r132023 r132309  
    467467NSString *_WebViewDidStartAcceleratedCompositingNotification = @"_WebViewDidStartAcceleratedCompositing";
    468468
     469NSString *WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey = @"WebKitKerningAndLigaturesEnabledByDefault";
     470
    469471@interface WebProgressItem : NSObject
    470472{
     
    31193121    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesRemovedNotification:) name:WebPreferencesRemovedNotification object:nil];   
    31203122
    3121     continuousSpellCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebContinuousSpellCheckingEnabled];
    3122     grammarCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebGrammarCheckingEnabled];
    3123 
    3124     Font::setDefaultTypesettingFeatures([[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitKerningAndLigaturesEnabledByDefault"] ? Kerning | Ligatures : 0);
     3123    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
     3124
     3125#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     3126    [defaults registerDefaults:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey]];
     3127#endif
     3128
     3129    continuousSpellCheckingEnabled = [defaults boolForKey:WebContinuousSpellCheckingEnabled];
     3130    grammarCheckingEnabled = [defaults boolForKey:WebGrammarCheckingEnabled];
     3131
     3132    Font::setDefaultTypesettingFeatures([defaults boolForKey:WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey] ? Kerning | Ligatures : 0);
    31253133
    31263134#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
    3127     automaticQuoteSubstitutionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticQuoteSubstitutionEnabled];
    3128     automaticLinkDetectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticLinkDetectionEnabled];
    3129     automaticDashSubstitutionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticDashSubstitutionEnabled];
    3130     automaticTextReplacementEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticTextReplacementEnabled];
    3131     automaticSpellingCorrectionEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebAutomaticSpellingCorrectionEnabled];
     3135    automaticQuoteSubstitutionEnabled = [defaults boolForKey:WebAutomaticQuoteSubstitutionEnabled];
     3136    automaticLinkDetectionEnabled = [defaults boolForKey:WebAutomaticLinkDetectionEnabled];
     3137    automaticDashSubstitutionEnabled = [defaults boolForKey:WebAutomaticDashSubstitutionEnabled];
     3138    automaticTextReplacementEnabled = [defaults boolForKey:WebAutomaticTextReplacementEnabled];
     3139    automaticSpellingCorrectionEnabled = [defaults boolForKey:WebAutomaticSpellingCorrectionEnabled];
    31323140#endif
    31333141
    31343142#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
    3135     if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticTextReplacementEnabled])
     3143    if (![defaults objectForKey:WebAutomaticTextReplacementEnabled])
    31363144        automaticTextReplacementEnabled = [NSSpellChecker isAutomaticTextReplacementEnabled];
    3137     if (![[NSUserDefaults standardUserDefaults] objectForKey:WebAutomaticSpellingCorrectionEnabled])
     3145    if (![defaults objectForKey:WebAutomaticSpellingCorrectionEnabled])
    31383146        automaticSpellingCorrectionEnabled = [NSSpellChecker isAutomaticSpellingCorrectionEnabled];
    31393147#endif
  • trunk/Source/WebKit2/ChangeLog

    r132296 r132309  
     12012-10-23  Dan Bernstein  <mitz@apple.com>
     2
     3        WebKit2 part of <rdar://problem/2966974> [mac] Kerning and ligatures are not enabled by default
     4        https://bugs.webkit.org/show_bug.cgi?id=100188
     5
     6        Reviewed by Sam Weinig.
     7
     8        * UIProcess/mac/WebContextMac.mm:
     9        (WebKit::registerUserDefaultsIfNeeded): Added. Registers a value of YES for the
     10        WebKitKerningAndLigaturesEnabledByDefault user default if it has not been registered yet.
     11        (WebKit::WebContext::platformInitializeWebProcess): Added a call to
     12        registerUserDefaultsIfNeeded, and changed to refer to the defaults key by name.
     13
    1142012-10-23  No'am Rosenthal  <noam.rosenthal@nokia.com>
    215
  • trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm

    r131545 r132309  
    4444NSString *WebKitLocalCacheDefaultsKey = @"WebKitLocalCache";
    4545NSString *WebStorageDirectoryDefaultsKey = @"WebKitLocalStorageDatabasePathPreferenceKey";
     46NSString *WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey = @"WebKitKerningAndLigaturesEnabledByDefault";
    4647
    4748static NSString *WebKitApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification = @"NSApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification";
     
    7475}
    7576
     77static void registerUserDefaultsIfNeeded()
     78{
     79    static bool didRegister;
     80    if (didRegister)
     81        return;
     82
     83    didRegister = true;
     84#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     85    [[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey]];
     86#endif
     87}
    7688
    7789void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
     
    8597    parameters.nsURLCacheDiskCapacity = [urlCache diskCapacity];
    8698
     99    registerUserDefaultsIfNeeded();
    87100#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
    88101    parameters.shouldForceScreenFontSubstitution = [[NSUserDefaults standardUserDefaults] boolForKey:@"NSFontDefaultScreenFontSubstitutionEnabled"];
    89102#endif
    90     parameters.shouldEnableKerningAndLigaturesByDefault = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitKerningAndLigaturesEnabledByDefault"];
     103    parameters.shouldEnableKerningAndLigaturesByDefault = [[NSUserDefaults standardUserDefaults] boolForKey:WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey];
    91104
    92105#if USE(ACCELERATED_COMPOSITING) && HAVE(HOSTED_CORE_ANIMATION)
  • trunk/Tools/ChangeLog

    r132301 r132309  
     12012-10-23  Dan Bernstein  <mitz@apple.com>
     2
     3        Tools changes for <rdar://problem/2966974> [mac] Kerning and ligatures are not enabled by default
     4        https://bugs.webkit.org/show_bug.cgi?id=100188
     5
     6        Reviewed by Sam Weinig.
     7
     8        Disable kerning and ligatures by default when running the tests.
     9
     10        * DumpRenderTree/mac/DumpRenderTree.mm:
     11        (resetDefaultsToConsistentValues): Set a value of NO for the
     12        WebKitKerningAndLigaturesEnabledByDefault user default.
     13        * WebKitTestRunner/mac/main.mm:
     14        (main): Register a value of NO for the WebKitKerningAndLigaturesEnabledByDefault user
     15        default.
     16
    1172012-10-23  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r132264 r132309  
    616616    [defaults setObject:[path stringByAppendingPathComponent:@"LocalCache"] forKey:WebKitLocalCacheDefaultsKey];
    617617
     618    [defaults setBool:NO forKey:@"WebKitKerningAndLigaturesEnabledByDefault"];
     619
    618620    WebPreferences *preferences = [WebPreferences standardPreferences];
    619621
  • trunk/Tools/WebKitTestRunner/mac/main.mm

    r81140 r132309  
    3232    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    3333    [NSApplication sharedApplication];
     34    [[NSUserDefaults standardUserDefaults] setVolatileDomain:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:@"WebKitKerningAndLigaturesEnabledByDefault"] forName:NSArgumentDomain];
    3435    {
    3536        WTR::TestController controller(argc, argv);
Note: See TracChangeset for help on using the changeset viewer.