Changeset 129593 in webkit


Ignore:
Timestamp:
Sep 25, 2012, 10:13:21 PM (13 years ago)
Author:
mitz@apple.com
Message:

Source/WebKit/mac: WebKit/mac part of <rdar://problem/11455228> [mac] Stop using screen fonts
https://bugs.webkit.org/show_bug.cgi?id=97620

Reviewed by John Sullivan.

  • WebView/WebPreferences.mm:

(+[WebPreferences initialize]): Changed the default value of the screenFontSubstitutionEnabled
preference to NO.

  • WebView/WebView.mm:

(-[WebView _preferencesChanged:]): Changed to enable screen font substitution also if
the value of the NSFontDefaultScreenFontSubstitutionEnabled user defaults key is YES.

Source/WebKit2: WebKit2 part of <rdar://problem/11455228> [mac] Stop using screen fonts
https://bugs.webkit.org/show_bug.cgi?id=97620

Reviewed by John Sullivan.

  • Shared/WebPreferencesStore.h:

(WebKit): Changed the default value of the screenFontSubstitutionEnabled preference to false.

  • Shared/WebProcessCreationParameters.cpp:

(WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Added an initializer for
the new shouldForceScreenFontSubstitution data member.
(WebKit::WebProcessCreationParameters::encode): Added encoding of shouldForceScreenFontSubstitution.
(WebKit::WebProcessCreationParameters::decode): Added decoding of shouldForceScreenFontSubstitution.

  • Shared/WebProcessCreationParameters.h:

(WebProcessCreationParameters): Added shouldForceScreenFontSubstitution boolean data member.

  • UIProcess/mac/WebContextMac.mm:

(WebKit::WebContext::platformInitializeWebProcess): Added code to set shouldForceScreenFontSubstitution
in the process creation parameters to the value of the NSFontDefaultScreenFontSubstitutionEnabled user
defaults key.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences): Changed to enable screen font substitution also if
shouldForceScreenFontSubstitution() is true.

  • WebProcess/WebProcess.h:

(WebKit::WebProcess::shouldForceScreenFontSubstitution): Added this getter.
(WebProcess): Added m_shouldForceScreenFontSubstitution boolean data member.

  • WebProcess/mac/WebProcessMac.mm:

(WebKit::WebProcess::platformInitializeWebProcess): Added initialization of
m_shouldForceScreenFontSubstitution from the creation parameters.

Tools: Tools part of <rdar://problem/11455228> [mac] Stop using screen fonts
https://bugs.webkit.org/show_bug.cgi?id=97620

Reviewed by John Sullivan.

  • DumpRenderTree/mac/DumpRenderTree.mm:

(resetDefaultsToConsistentValues): Enable screen font substitution when
running the tests.

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetStateToConsistentValues): Ditto.

Location:
trunk
Files:
14 edited

Legend:

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

    r129567 r129593  
     12012-09-25  Dan Bernstein  <mitz@apple.com>
     2
     3        WebKit/mac part of <rdar://problem/11455228> [mac] Stop using screen fonts
     4        https://bugs.webkit.org/show_bug.cgi?id=97620
     5
     6        Reviewed by John Sullivan.
     7
     8        * WebView/WebPreferences.mm:
     9        (+[WebPreferences initialize]): Changed the default value of the screenFontSubstitutionEnabled
     10        preference to NO.
     11        * WebView/WebView.mm:
     12        (-[WebView _preferencesChanged:]):  Changed to enable screen font substitution also if
     13        the value of the NSFontDefaultScreenFontSubstitutionEnabled user defaults key is YES.
     14
    1152012-09-21  Jeffrey Pfau  <jpfau@apple.com>
    216
  • trunk/Source/WebKit/mac/WebView/WebPreferences.mm

    r129567 r129593  
    400400        [NSNumber numberWithBool:NO],   WebKitWantsBalancedSetDefersLoadingBehaviorKey,
    401401        [NSNumber numberWithBool:NO],   WebKitDiagnosticLoggingEnabledKey,
    402         [NSNumber numberWithBool:YES],  WebKitScreenFontSubstitutionEnabledKey,
     402#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     403        [NSNumber numberWithBool:NO],
     404#else
     405        [NSNumber numberWithBool:YES],
     406#endif
     407                                        WebKitScreenFontSubstitutionEnabledKey,
    403408        [NSNumber numberWithInt:WebAllowAllStorage], WebKitStorageBlockingPolicyKey,
    404409
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r129567 r129593  
    14451445    settings->setFantasyFontFamily([preferences fantasyFontFamily]);
    14461446    settings->setFixedFontFamily([preferences fixedFontFamily]);
    1447     settings->setScreenFontSubstitutionEnabled([preferences screenFontSubstitutionEnabled]);
     1447    settings->setScreenFontSubstitutionEnabled(
     1448#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     1449        [[NSUserDefaults standardUserDefaults] boolForKey:@"NSFontDefaultScreenFontSubstitutionEnabled"] ||
     1450#endif
     1451        [preferences screenFontSubstitutionEnabled]
     1452    );
    14481453    settings->setForceFTPDirectoryListings([preferences _forceFTPDirectoryListings]);
    14491454    settings->setFTPDirectoryTemplatePath([preferences _ftpDirectoryTemplatePath]);
  • trunk/Source/WebKit2/ChangeLog

    r129575 r129593  
     12012-09-25  Dan Bernstein  <mitz@apple.com>
     2
     3        WebKit2 part of <rdar://problem/11455228> [mac] Stop using screen fonts
     4        https://bugs.webkit.org/show_bug.cgi?id=97620
     5
     6        Reviewed by John Sullivan.
     7
     8        * Shared/WebPreferencesStore.h:
     9        (WebKit): Changed the default value of the screenFontSubstitutionEnabled preference to false.
     10        * Shared/WebProcessCreationParameters.cpp:
     11        (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Added an initializer for
     12        the new shouldForceScreenFontSubstitution data member.
     13        (WebKit::WebProcessCreationParameters::encode): Added encoding of shouldForceScreenFontSubstitution.
     14        (WebKit::WebProcessCreationParameters::decode): Added decoding of shouldForceScreenFontSubstitution.
     15        * Shared/WebProcessCreationParameters.h:
     16        (WebProcessCreationParameters): Added shouldForceScreenFontSubstitution boolean data member.
     17        * UIProcess/mac/WebContextMac.mm:
     18        (WebKit::WebContext::platformInitializeWebProcess): Added code to set shouldForceScreenFontSubstitution
     19        in the process creation parameters to the value of the NSFontDefaultScreenFontSubstitutionEnabled user
     20        defaults key.
     21        * WebProcess/WebPage/WebPage.cpp:
     22        (WebKit::WebPage::updatePreferences): Changed to enable screen font substitution also if
     23        shouldForceScreenFontSubstitution() is true.
     24        * WebProcess/WebProcess.h:
     25        (WebKit::WebProcess::shouldForceScreenFontSubstitution): Added this getter.
     26        (WebProcess): Added m_shouldForceScreenFontSubstitution boolean data member.
     27        * WebProcess/mac/WebProcessMac.mm:
     28        (WebKit::WebProcess::platformInitializeWebProcess): Added initialization of
     29        m_shouldForceScreenFontSubstitution from the creation parameters.
     30
    1312012-09-25  Alexey Proskuryakov  <ap@apple.com>
    232
  • trunk/Source/WebKit2/Shared/WebPreferencesStore.h

    r129097 r129593  
    5353#else
    5454#define DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED false
     55#endif
     56
     57#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     58#define DEFAULT_SCREEN_FONT_SUBSTITUTION_ENABLED false
     59#else
     60#define DEFAULT_SCREEN_FONT_SUBSTITUTION_ENABLED true
    5561#endif
    5662
     
    129135    macro(StorageBlockingPolicy, storageBlockingPolicy, UInt32, uint32_t, 0) \
    130136    macro(ScrollAnimatorEnabled, scrollAnimatorEnabled, Bool, bool, DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED) \
    131     macro(ScreenFontSubstitutionEnabled, screenFontSubstitutionEnabled, Bool, bool, true) \
     137    macro(ScreenFontSubstitutionEnabled, screenFontSubstitutionEnabled, Bool, bool, DEFAULT_SCREEN_FONT_SUBSTITUTION_ENABLED) \
    132138    \
    133139
  • trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp

    r128989 r129593  
    4242    , nsURLCacheMemoryCapacity(0)
    4343    , nsURLCacheDiskCapacity(0)
     44    , shouldForceScreenFontSubstitution(false)
    4445#elif PLATFORM(WIN)
    4546    , shouldPaintNativeControls(false)
     
    9293    encoder->encode(uiProcessBundleResourcePath);
    9394    encoder->encode(uiProcessBundleResourcePathExtensionHandle);
     95    encoder->encode(shouldForceScreenFontSubstitution);
    9496#elif PLATFORM(WIN)
    9597    encoder->encode(shouldPaintNativeControls);
     
    197199    if (!decoder->decode(parameters.uiProcessBundleResourcePathExtensionHandle))
    198200        return false;
     201    if (!decoder->decode(parameters.shouldForceScreenFontSubstitution))
     202        return false;
    199203#elif PLATFORM(WIN)
    200204    if (!decoder->decode(parameters.shouldPaintNativeControls))
  • trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h

    r128989 r129593  
    116116    SandboxExtension::Handle uiProcessBundleResourcePathExtensionHandle;
    117117
     118    bool shouldForceScreenFontSubstitution;
    118119#elif PLATFORM(WIN)
    119120    String cfURLCachePath;
  • trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm

    r128352 r129593  
    9898    parameters.nsURLCacheDiskCapacity = [urlCache diskCapacity];
    9999
     100#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     101    parameters.shouldForceScreenFontSubstitution = [[NSUserDefaults standardUserDefaults] boolForKey:@"NSFontDefaultScreenFontSubstitutionEnabled"];
     102#endif
    100103
    101104#if ENABLE(PLUGIN_PROCESS)
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r129545 r129593  
    20732073    settings->setDefaultFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFontSizeKey()));
    20742074    settings->setDefaultFixedFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFixedFontSizeKey()));
    2075     settings->setScreenFontSubstitutionEnabled(store.getBoolValueForKey(WebPreferencesKey::screenFontSubstitutionEnabledKey()));
     2075    settings->setScreenFontSubstitutionEnabled(store.getBoolValueForKey(WebPreferencesKey::screenFontSubstitutionEnabledKey()) || WebProcess::shared().shouldForceScreenFontSubstitution());
    20762076    settings->setLayoutFallbackWidth(store.getUInt32ValueForKey(WebPreferencesKey::layoutFallbackWidthKey()));
    20772077    settings->setDeviceWidth(store.getUInt32ValueForKey(WebPreferencesKey::deviceWidthKey()));
  • trunk/Source/WebKit2/WebProcess/WebProcess.h

    r128989 r129593  
    150150#if PLATFORM(MAC)
    151151    pid_t presenterApplicationPid() const { return m_presenterApplicationPid; }
     152    bool shouldForceScreenFontSubstitution() const { return m_shouldForceScreenFontSubstitution; }
    152153#endif
    153154   
     
    305306    pid_t m_presenterApplicationPid;
    306307    dispatch_group_t m_clearResourceCachesDispatchGroup;
     308    bool m_shouldForceScreenFontSubstitution;
    307309#endif
    308310
  • trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm

    r129293 r129593  
    272272    }
    273273
     274    m_shouldForceScreenFontSubstitution = parameters.shouldForceScreenFontSubstitution;
     275
    274276    m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port();
    275277
  • trunk/Tools/ChangeLog

    r129589 r129593  
     12012-09-25  Dan Bernstein  <mitz@apple.com>
     2
     3        Tools part of <rdar://problem/11455228> [mac] Stop using screen fonts
     4        https://bugs.webkit.org/show_bug.cgi?id=97620
     5
     6        Reviewed by John Sullivan.
     7
     8        * DumpRenderTree/mac/DumpRenderTree.mm:
     9        (resetDefaultsToConsistentValues): Enable screen font substitution when
     10        running the tests.
     11        * WebKitTestRunner/TestController.cpp:
     12        (WTR::TestController::resetStateToConsistentValues): Ditto.
     13
    1142012-09-25  Ryosuke Niwa  <rniwa@webkit.org>
    215
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r128864 r129593  
    675675#endif
    676676
     677    [preferences setScreenFontSubstitutionEnabled:YES];
     678
    677679    [WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
    678680   
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r129545 r129593  
    516516    WKPreferencesSetSerifFontFamily(preferences, serifFontFamily);
    517517#endif
     518    WKPreferencesSetScreenFontSubstitutionEnabled(preferences, true);
    518519    WKPreferencesSetInspectorUsesWebKitUserInterface(preferences, true);
    519520
Note: See TracChangeset for help on using the changeset viewer.