Title: [129593] trunk
Revision
129593
Author
[email protected]
Date
2012-09-25 22:13:21 -0700 (Tue, 25 Sep 2012)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebKit/mac/ChangeLog (129592 => 129593)


--- trunk/Source/WebKit/mac/ChangeLog	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-09-26 05:13:21 UTC (rev 129593)
@@ -1,3 +1,17 @@
+2012-09-25  Dan Bernstein  <[email protected]>
+
+        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.
+
 2012-09-21  Jeffrey Pfau  <[email protected]>
 
         Add WebKit1 SPI for storage blocking preference

Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (129592 => 129593)


--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2012-09-26 05:13:21 UTC (rev 129593)
@@ -399,7 +399,12 @@
         [NSNumber numberWithBool:YES],  WebKitRequestAnimationFrameEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitWantsBalancedSetDefersLoadingBehaviorKey,
         [NSNumber numberWithBool:NO],   WebKitDiagnosticLoggingEnabledKey,
-        [NSNumber numberWithBool:YES],  WebKitScreenFontSubstitutionEnabledKey,
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+        [NSNumber numberWithBool:NO],
+#else
+        [NSNumber numberWithBool:YES],
+#endif
+                                        WebKitScreenFontSubstitutionEnabledKey,
         [NSNumber numberWithInt:WebAllowAllStorage], WebKitStorageBlockingPolicyKey,
 
         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (129592 => 129593)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2012-09-26 05:13:21 UTC (rev 129593)
@@ -1444,7 +1444,12 @@
     settings->setUsesEncodingDetector([preferences usesEncodingDetector]);
     settings->setFantasyFontFamily([preferences fantasyFontFamily]);
     settings->setFixedFontFamily([preferences fixedFontFamily]);
-    settings->setScreenFontSubstitutionEnabled([preferences screenFontSubstitutionEnabled]);
+    settings->setScreenFontSubstitutionEnabled(
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+        [[NSUserDefaults standardUserDefaults] boolForKey:@"NSFontDefaultScreenFontSubstitutionEnabled"] ||
+#endif
+        [preferences screenFontSubstitutionEnabled]
+    );
     settings->setForceFTPDirectoryListings([preferences _forceFTPDirectoryListings]);
     settings->setFTPDirectoryTemplatePath([preferences _ftpDirectoryTemplatePath]);
     settings->setLocalStorageDatabasePath([preferences _localStorageDatabasePath]);

Modified: trunk/Source/WebKit2/ChangeLog (129592 => 129593)


--- trunk/Source/WebKit2/ChangeLog	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-26 05:13:21 UTC (rev 129593)
@@ -1,3 +1,33 @@
+2012-09-25  Dan Bernstein  <[email protected]>
+
+        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.
+
 2012-09-25  Alexey Proskuryakov  <[email protected]>
 
         Get rid of WebContext::m_pendingMessagesToPostToInjectedBundle

Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.h (129592 => 129593)


--- trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.h	2012-09-26 05:13:21 UTC (rev 129593)
@@ -54,6 +54,12 @@
 #define DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED false
 #endif
 
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+#define DEFAULT_SCREEN_FONT_SUBSTITUTION_ENABLED false
+#else
+#define DEFAULT_SCREEN_FONT_SUBSTITUTION_ENABLED true
+#endif
+
 #define FOR_EACH_WEBKIT_BOOL_PREFERENCE(macro) \
     macro(_javascript_Enabled, _javascript_Enabled, Bool, bool, true) \
     macro(LoadsImagesAutomatically, loadsImagesAutomatically, Bool, bool, true) \
@@ -128,7 +134,7 @@
     macro(ScrollingPerformanceLoggingEnabled, scrollingPerformanceLoggingEnabled, Bool, bool, false) \
     macro(StorageBlockingPolicy, storageBlockingPolicy, UInt32, uint32_t, 0) \
     macro(ScrollAnimatorEnabled, scrollAnimatorEnabled, Bool, bool, DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED) \
-    macro(ScreenFontSubstitutionEnabled, screenFontSubstitutionEnabled, Bool, bool, true) \
+    macro(ScreenFontSubstitutionEnabled, screenFontSubstitutionEnabled, Bool, bool, DEFAULT_SCREEN_FONT_SUBSTITUTION_ENABLED) \
     \
 
 #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \

Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp (129592 => 129593)


--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp	2012-09-26 05:13:21 UTC (rev 129593)
@@ -41,6 +41,7 @@
 #if PLATFORM(MAC)
     , nsURLCacheMemoryCapacity(0)
     , nsURLCacheDiskCapacity(0)
+    , shouldForceScreenFontSubstitution(false)
 #elif PLATFORM(WIN)
     , shouldPaintNativeControls(false)
 #endif
@@ -91,6 +92,7 @@
     encoder->encode(acceleratedCompositingPort);
     encoder->encode(uiProcessBundleResourcePath);
     encoder->encode(uiProcessBundleResourcePathExtensionHandle);
+    encoder->encode(shouldForceScreenFontSubstitution);
 #elif PLATFORM(WIN)
     encoder->encode(shouldPaintNativeControls);
     encoder->encode(cfURLCachePath);
@@ -196,6 +198,8 @@
         return false;
     if (!decoder->decode(parameters.uiProcessBundleResourcePathExtensionHandle))
         return false;
+    if (!decoder->decode(parameters.shouldForceScreenFontSubstitution))
+        return false;
 #elif PLATFORM(WIN)
     if (!decoder->decode(parameters.shouldPaintNativeControls))
         return false;

Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h (129592 => 129593)


--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h	2012-09-26 05:13:21 UTC (rev 129593)
@@ -115,6 +115,7 @@
     String uiProcessBundleResourcePath;
     SandboxExtension::Handle uiProcessBundleResourcePathExtensionHandle;
 
+    bool shouldForceScreenFontSubstitution;
 #elif PLATFORM(WIN)
     String cfURLCachePath;
     uint64_t cfURLCacheDiskCapacity;

Modified: trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm (129592 => 129593)


--- trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm	2012-09-26 05:13:21 UTC (rev 129593)
@@ -97,6 +97,9 @@
     parameters.nsURLCacheMemoryCapacity = [urlCache memoryCapacity];
     parameters.nsURLCacheDiskCapacity = [urlCache diskCapacity];
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+    parameters.shouldForceScreenFontSubstitution = [[NSUserDefaults standardUserDefaults] boolForKey:@"NSFontDefaultScreenFontSubstitutionEnabled"];
+#endif
 
 #if ENABLE(PLUGIN_PROCESS)
     parameters.disablePluginProcessMessageTimeout = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitDisablePluginProcessMessageTimeout"];

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (129592 => 129593)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-09-26 05:13:21 UTC (rev 129593)
@@ -2072,7 +2072,7 @@
     settings->setMinimumLogicalFontSize(store.getUInt32ValueForKey(WebPreferencesKey::minimumLogicalFontSizeKey()));
     settings->setDefaultFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFontSizeKey()));
     settings->setDefaultFixedFontSize(store.getUInt32ValueForKey(WebPreferencesKey::defaultFixedFontSizeKey()));
-    settings->setScreenFontSubstitutionEnabled(store.getBoolValueForKey(WebPreferencesKey::screenFontSubstitutionEnabledKey()));
+    settings->setScreenFontSubstitutionEnabled(store.getBoolValueForKey(WebPreferencesKey::screenFontSubstitutionEnabledKey()) || WebProcess::shared().shouldForceScreenFontSubstitution());
     settings->setLayoutFallbackWidth(store.getUInt32ValueForKey(WebPreferencesKey::layoutFallbackWidthKey()));
     settings->setDeviceWidth(store.getUInt32ValueForKey(WebPreferencesKey::deviceWidthKey()));
     settings->setDeviceHeight(store.getUInt32ValueForKey(WebPreferencesKey::deviceHeightKey()));

Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (129592 => 129593)


--- trunk/Source/WebKit2/WebProcess/WebProcess.h	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h	2012-09-26 05:13:21 UTC (rev 129593)
@@ -149,6 +149,7 @@
     WebPageGroupProxy* webPageGroup(const WebPageGroupData&);
 #if PLATFORM(MAC)
     pid_t presenterApplicationPid() const { return m_presenterApplicationPid; }
+    bool shouldForceScreenFontSubstitution() const { return m_shouldForceScreenFontSubstitution; }
 #endif 
     
 #if PLATFORM(QT)
@@ -304,6 +305,7 @@
 #if PLATFORM(MAC)
     pid_t m_presenterApplicationPid;
     dispatch_group_t m_clearResourceCachesDispatchGroup;
+    bool m_shouldForceScreenFontSubstitution;
 #endif
 
     bool m_fullKeyboardAccessEnabled;

Modified: trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm (129592 => 129593)


--- trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm	2012-09-26 05:13:21 UTC (rev 129593)
@@ -271,6 +271,8 @@
         [NSURLCache setSharedURLCache:parentProcessURLCache.get()];
     }
 
+    m_shouldForceScreenFontSubstitution = parameters.shouldForceScreenFontSubstitution;
+
     m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port();
 
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)

Modified: trunk/Tools/ChangeLog (129592 => 129593)


--- trunk/Tools/ChangeLog	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Tools/ChangeLog	2012-09-26 05:13:21 UTC (rev 129593)
@@ -1,3 +1,16 @@
+2012-09-25  Dan Bernstein  <[email protected]>
+
+        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.
+
 2012-09-25  Ryosuke Niwa  <[email protected]>
 
         Build fix. "values" doesn't necessarily contain multiple values but it needs to be always parsed as an array.

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (129592 => 129593)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2012-09-26 05:13:21 UTC (rev 129593)
@@ -674,6 +674,8 @@
     [preferences setWebAudioEnabled:YES];
 #endif
 
+    [preferences setScreenFontSubstitutionEnabled:YES];
+
     [WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
     
     TestRunner::setSerializeHTTPLoads(false);

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (129592 => 129593)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2012-09-26 04:45:35 UTC (rev 129592)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2012-09-26 05:13:21 UTC (rev 129593)
@@ -515,6 +515,7 @@
     WKPreferencesSetSansSerifFontFamily(preferences, sansSerifFontFamily);
     WKPreferencesSetSerifFontFamily(preferences, serifFontFamily);
 #endif
+    WKPreferencesSetScreenFontSubstitutionEnabled(preferences, true);
     WKPreferencesSetInspectorUsesWebKitUserInterface(preferences, true);
 
     // in the case that a test using the chrome input field failed, be sure to clean up for the next test
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to