Changeset 158652 in webkit


Ignore:
Timestamp:
Nov 4, 2013 11:05:59 PM (10 years ago)
Author:
ap@apple.com
Message:

DumpRenderTree should reset its preferences file on launch
https://bugs.webkit.org/show_bug.cgi?id=29751

Reviewed by Dan Bernstein.

Source/WebKit/mac:

  • WebView/WebView.mm:

(-[WebView _retrieveKeyboardUIModeFromPreferences:]):
Further fix reading of AppleKeyboardUIMode - reading it from kCFPreferencesAnyApplication
domain meant that current application's domain was explcitly ignored, and the only
way to override the setting in DRT was through argument domain.

Source/WebKit2:

  • UIProcess/mac/WKFullKeyboardAccessWatcher.mm:

(-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
Further fix reading of AppleKeyboardUIMode - reading it from kCFPreferencesAnyApplication
domain meant that current application's domain was explcitly ignored, and the only
way to override the setting in WTR was through argument domain.

Tools:

Using NSArgumentDomain was not a good idea. While it works with NSUserDefaults
and CFPreferencesCopyAppValue family of functions, it doesn't work with
CFPreferencesCopyValue(..., kCFPreferencesCurrentApplication, ...).

So, now we'll just set defaults in the current application.

  • DumpRenderTree/mac/DumpRenderTree.mm: (setDefaultsToConsistentValuesForTesting):
  • Delete the defaults.
  • Removed CFPreferencesSetAppValue calls, as -setValuesForKeysWithDictionary: does the same.
  • The comment about [NSUserDefaults standardUserDefaults] indirectly initializing NSApplication was incorrect.
  • WebKitTestRunner/mac/main.mm: (setDefaultsToConsistentValuesForTesting):

Switched to -setValuesForKeysWithDictionary for consistency.

Location:
trunk
Files:
7 edited

Legend:

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

    r158599 r158652  
     12013-11-04  Alexey Proskuryakov  <ap@apple.com>
     2
     3        DumpRenderTree should reset its preferences file on launch
     4        https://bugs.webkit.org/show_bug.cgi?id=29751
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * WebView/WebView.mm:
     9        (-[WebView _retrieveKeyboardUIModeFromPreferences:]):
     10        Further fix reading of AppleKeyboardUIMode - reading it from kCFPreferencesAnyApplication
     11        domain meant that current application's domain was explcitly ignored, and the only
     12        way to override the setting in DRT was through argument domain.
     13
    1142013-11-01  Jer Noble  <jer.noble@apple.com>
    215
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r158599 r158652  
    65246524- (void)_retrieveKeyboardUIModeFromPreferences:(NSNotification *)notification
    65256525{
    6526     CFPreferencesAppSynchronize(kCFPreferencesAnyApplication);
     6526    CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
    65276527
    65286528    Boolean keyExistsAndHasValidFormat;
    6529     int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, kCFPreferencesAnyApplication, &keyExistsAndHasValidFormat);
     6529    int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat);
    65306530
    65316531    // The keyboard access mode has two bits:
  • trunk/Source/WebKit2/ChangeLog

    r158647 r158652  
     12013-11-04  Alexey Proskuryakov  <ap@apple.com>
     2
     3        DumpRenderTree should reset its preferences file on launch
     4        https://bugs.webkit.org/show_bug.cgi?id=29751
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * UIProcess/mac/WKFullKeyboardAccessWatcher.mm:
     9        (-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]):
     10        Further fix reading of AppleKeyboardUIMode - reading it from kCFPreferencesAnyApplication
     11        domain meant that current application's domain was explcitly ignored, and the only
     12        way to override the setting in WTR was through argument domain.
     13
    1142013-11-04  Tim Horton  <timothy_horton@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/mac/WKFullKeyboardAccessWatcher.mm

    r158256 r158652  
    4747    BOOL oldValue = fullKeyboardAccessEnabled;
    4848
    49     CFPreferencesAppSynchronize(kCFPreferencesAnyApplication);
     49    CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
    5050
    5151    Boolean keyExistsAndHasValidFormat;
    52     int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, kCFPreferencesAnyApplication, &keyExistsAndHasValidFormat);
     52    int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, kCFPreferencesCurrentApplication, &keyExistsAndHasValidFormat);
    5353    if (keyExistsAndHasValidFormat) {
    5454        // The keyboard access mode has two bits:
  • trunk/Tools/ChangeLog

    r158643 r158652  
     12013-11-04  Alexey Proskuryakov  <ap@apple.com>
     2
     3        DumpRenderTree should reset its preferences file on launch
     4        https://bugs.webkit.org/show_bug.cgi?id=29751
     5
     6        Reviewed by Dan Bernstein.
     7
     8        Using NSArgumentDomain was not a good idea. While it works with NSUserDefaults
     9        and CFPreferencesCopyAppValue family of functions, it doesn't work with
     10        CFPreferencesCopyValue(..., kCFPreferencesCurrentApplication, ...).
     11
     12        So, now we'll just set defaults in the current application.
     13
     14        * DumpRenderTree/mac/DumpRenderTree.mm: (setDefaultsToConsistentValuesForTesting):
     15        - Delete the defaults.
     16        - Removed CFPreferencesSetAppValue calls, as -setValuesForKeysWithDictionary: does the same.
     17        - The comment about [NSUserDefaults standardUserDefaults] indirectly initializing NSApplication was incorrect.
     18
     19        * WebKitTestRunner/mac/main.mm: (setDefaultsToConsistentValuesForTesting):
     20        Switched to -setValuesForKeysWithDictionary for consistency.
     21
    1222013-11-04  Filip Pizlo  <fpizlo@apple.com>
    223
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r158290 r158652  
    680680    static const int BlueTintedAppearance = 1;
    681681
    682     // These defaults are read at NSApplication initialization time, and there is no way to fully reset them afterwards.
    683     // We have to use CFPreferences, because [NSUserDefaults standardUserDefaults] indirectly initializes NSApplication.
    684     CFPreferencesSetAppValue(CFSTR("AppleFontSmoothing"), (CFNumberRef)@(NoFontSmoothing), kCFPreferencesCurrentApplication);
    685     CFPreferencesSetAppValue(CFSTR("AppleAntiAliasingThreshold"), (CFNumberRef)@4, kCFPreferencesCurrentApplication);
    686     CFPreferencesSetAppValue(CFSTR("AppleLanguages"), (CFArrayRef)@[ @"en" ], kCFPreferencesCurrentApplication);
     682    [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:@"DumpRenderTree"];
    687683
    688684    NSString *libraryPath = libraryPathForDumpRenderTree();
     
    717713    };
    718714
    719     [[NSUserDefaults standardUserDefaults] setVolatileDomain:dict forName:NSArgumentDomain];
     715    [[NSUserDefaults standardUserDefaults] setValuesForKeysWithDictionary:dict];
    720716}
    721717
  • trunk/Tools/WebKitTestRunner/mac/main.mm

    r158326 r158652  
    4141    };
    4242
    43     [[NSUserDefaults standardUserDefaults] setVolatileDomain:dict forName:NSArgumentDomain];
     43    [[NSUserDefaults standardUserDefaults] setValuesForKeysWithDictionary:dict];
    4444}
    4545
Note: See TracChangeset for help on using the changeset viewer.