Diff
Modified: trunk/Source/WebCore/ChangeLog (129096 => 129097)
--- trunk/Source/WebCore/ChangeLog 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebCore/ChangeLog 2012-09-20 06:55:54 UTC (rev 129097)
@@ -1,3 +1,23 @@
+2012-09-19 Dan Bernstein <[email protected]>
+
+ WebCore part of adding a setting and API for disabling screen font substitution
+ https://bugs.webkit.org/show_bug.cgi?id=97168
+
+ Reviewed by Tim Horton.
+
+ * WebCore.exp.in: Added an entry for Settings::setScreenFontSubstitutionEnabled.
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::collectMatchingRulesForList): Changed to use printer fonts if
+ screen font substitution is not enabled.
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings): Added initializer for new m_screenFontSubstitutionEnabled
+ member variable. The initial value is true, matching existing behavior.
+ (WebCore::Settings::setScreenFontSubstitutionEnabled): Added this setter, which updated the
+ member variable and forces a style recalc in all pages using this Settings.
+ * page/Settings.h:
+ (Settings): Added m_screenFontSubstitutionEnabled boolean member variable.
+ (WebCore::Settings::screenFontSubstitutionEnabled): Added this getter.
+
2012-09-19 Yoshifumi Inoue <[email protected]>
[Forms] multiple fields time input UI should call notifyFormStateChanged() when value of field is changed
Modified: trunk/Source/WebCore/WebCore.exp.in (129096 => 129097)
--- trunk/Source/WebCore/WebCore.exp.in 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebCore/WebCore.exp.in 2012-09-20 06:55:54 UTC (rev 129097)
@@ -914,6 +914,7 @@
__ZN7WebCore8Settings31setShrinksStandaloneImagesToFitEb
__ZN7WebCore8Settings32setAcceleratedCompositingEnabledEb
__ZN7WebCore8Settings32setNeedsAdobeFrameReloadingQuirkEb
+__ZN7WebCore8Settings32setScreenFontSubstitutionEnabledEb
__ZN7WebCore8Settings32setShowsToolTipOverTruncatedTextEb
__ZN7WebCore8Settings33setDownloadableBinaryFontsEnabledEb
__ZN7WebCore8Settings34setLocalFileContentSniffingEnabledEb
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (129096 => 129097)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2012-09-20 06:55:54 UTC (rev 129097)
@@ -1712,9 +1712,9 @@
return documentStyle.release();
FontDescription fontDescription;
- fontDescription.setUsePrinterFont(document->printing());
fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle->locale()));
if (Settings* settings = document->settings()) {
+ fontDescription.setUsePrinterFont(document->printing() || !settings->screenFontSubstitutionEnabled());
fontDescription.setRenderingMode(settings->fontRenderingMode());
const AtomicString& standardFont = settings->standardFontFamily(fontDescription.script());
if (!standardFont.isEmpty()) {
@@ -1727,7 +1727,8 @@
fontDescription.setSpecifiedSize(size);
bool useSVGZoomRules = document->isSVGDocument();
fontDescription.setComputedSize(StyleResolver::getComputedSizeFromSpecifiedSize(document, documentStyle.get(), fontDescription.isAbsoluteSize(), size, useSVGZoomRules));
- }
+ } else
+ fontDescription.setUsePrinterFont(document->printing());
documentStyle->setFontDescription(fontDescription);
documentStyle->font().update(fontSelector);
@@ -3728,7 +3729,7 @@
if (!settings)
return;
fontDescription.setRenderingMode(settings->fontRenderingMode());
- fontDescription.setUsePrinterFont(m_checker.document()->printing());
+ fontDescription.setUsePrinterFont(m_checker.document()->printing() || !settings->screenFontSubstitutionEnabled());
// Handle the zoom factor.
fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(m_checker.document(), m_style.get(), fontDescription.isAbsoluteSize(), fontDescription.specifiedSize(), useSVGZoomRules()));
@@ -4609,7 +4610,7 @@
FontDescription fontDescription;
fontDescription.setGenericFamily(FontDescription::StandardFamily);
fontDescription.setRenderingMode(settings->fontRenderingMode());
- fontDescription.setUsePrinterFont(m_checker.document()->printing());
+ fontDescription.setUsePrinterFont(m_checker.document()->printing() || !settings->screenFontSubstitutionEnabled());
const AtomicString& standardFontFamily = documentSettings()->standardFontFamily();
if (!standardFontFamily.isEmpty()) {
fontDescription.firstFamily().setFamily(standardFontFamily);
Modified: trunk/Source/WebCore/page/Settings.cpp (129096 => 129097)
--- trunk/Source/WebCore/page/Settings.cpp 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebCore/page/Settings.cpp 2012-09-20 06:55:54 UTC (rev 129097)
@@ -130,6 +130,7 @@
, m_minimumLogicalFontSize(0)
, m_defaultFontSize(0)
, m_defaultFixedFontSize(0)
+ , m_screenFontSubstitutionEnabled(true)
, m_validationMessageTimerMagnification(50)
, m_minimumAccelerated2dCanvasSize(257 * 256)
, m_layoutFallbackWidth(980)
@@ -418,6 +419,15 @@
m_page->setNeedsRecalcStyleInAllFrames();
}
+void Settings::setScreenFontSubstitutionEnabled(bool screenFontSubstitutionEnabled)
+{
+ if (m_screenFontSubstitutionEnabled == screenFontSubstitutionEnabled)
+ return;
+
+ m_screenFontSubstitutionEnabled = screenFontSubstitutionEnabled;
+ m_page->setNeedsRecalcStyleInAllFrames();
+}
+
#if ENABLE(TEXT_AUTOSIZING)
void Settings::setTextAutosizingEnabled(bool textAutosizingEnabled)
{
Modified: trunk/Source/WebCore/page/Settings.h (129096 => 129097)
--- trunk/Source/WebCore/page/Settings.h 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebCore/page/Settings.h 2012-09-20 06:55:54 UTC (rev 129097)
@@ -108,6 +108,9 @@
void setDefaultFixedFontSize(int);
int defaultFixedFontSize() const { return m_defaultFixedFontSize; }
+ void setScreenFontSubstitutionEnabled(bool);
+ bool screenFontSubstitutionEnabled() const { return m_screenFontSubstitutionEnabled; }
+
#if ENABLE(TEXT_AUTOSIZING)
void setTextAutosizingEnabled(bool);
bool textAutosizingEnabled() const { return m_textAutosizingEnabled; }
@@ -655,6 +658,7 @@
int m_minimumLogicalFontSize;
int m_defaultFontSize;
int m_defaultFixedFontSize;
+ bool m_screenFontSubstitutionEnabled;
int m_validationMessageTimerMagnification;
int m_minimumAccelerated2dCanvasSize;
int m_layoutFallbackWidth;
Modified: trunk/Source/WebKit/mac/ChangeLog (129096 => 129097)
--- trunk/Source/WebKit/mac/ChangeLog 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebKit/mac/ChangeLog 2012-09-20 06:55:54 UTC (rev 129097)
@@ -1,3 +1,19 @@
+2012-09-19 Dan Bernstein <[email protected]>
+
+ WebKit/mac part of adding a setting and API for disabling screen font substitution
+ https://bugs.webkit.org/show_bug.cgi?id=97168
+
+ Reviewed by Tim Horton.
+
+ * WebView/WebPreferenceKeysPrivate.h: Defined WebKitScreenFontSubstitutionEnabledKey.
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]): Added a default value of YES for the new preference key.
+ (-[WebPreferences setScreenFontSubstitutionEnabled:]): Added this setter.
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChanged:]): Added a call to Settings::setScreenFontSubstitutionEnabled
+ to push the preference down to Settings.
+
2012-09-17 Dan Bernstein <[email protected]>
<rdar://problem/12316935> [mac WebKit1]: -[WebView _setPaginationBehavesLikeColumns:] is a no-op
Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (129096 => 129097)
--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h 2012-09-20 06:55:54 UTC (rev 129097)
@@ -125,6 +125,7 @@
#define WebKitShouldRespectImageOrientationKey @"WebKitShouldRespectImageOrientation"
#define WebKitRequestAnimationFrameEnabledPreferenceKey @"WebKitRequestAnimationFrameEnabled"
#define WebKitDiagnosticLoggingEnabledKey @"WebKitDiagnosticLoggingEnabled"
+#define WebKitScreenFontSubstitutionEnabledKey @"WebKitScreenFontSubstitutionEnabled"
// These are private both because callers should be using the cover methods and because the
// cover methods themselves are private.
Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (129096 => 129097)
--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm 2012-09-20 06:55:54 UTC (rev 129097)
@@ -399,6 +399,7 @@
[NSNumber numberWithBool:YES], WebKitRequestAnimationFrameEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitWantsBalancedSetDefersLoadingBehaviorKey,
[NSNumber numberWithBool:NO], WebKitDiagnosticLoggingEnabledKey,
+ [NSNumber numberWithBool:YES], WebKitScreenFontSubstitutionEnabledKey,
[NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
[NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
@@ -1739,6 +1740,16 @@
[self _setBoolValue:enabled forKey:WebKitDiagnosticLoggingEnabledKey];
}
+- (BOOL)screenFontSubstitutionEnabled
+{
+ return [self _boolValueForKey:WebKitScreenFontSubstitutionEnabledKey];
+}
+
+- (void)setScreenFontSubstitutionEnabled:(BOOL)enabled
+{
+ [self _setBoolValue:enabled forKey:WebKitScreenFontSubstitutionEnabledKey];
+}
+
@end
@implementation WebPreferences (WebInternal)
Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (129096 => 129097)
--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2012-09-20 06:55:54 UTC (rev 129097)
@@ -305,4 +305,7 @@
- (BOOL)diagnosticLoggingEnabled;
- (void)setDiagnosticLoggingEnabled:(BOOL)enabled;
+- (BOOL)screenFontSubstitutionEnabled;
+- (void)setScreenFontSubstitutionEnabled:(BOOL)enabled;
+
@end
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (129096 => 129097)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2012-09-20 06:55:54 UTC (rev 129097)
@@ -1430,6 +1430,7 @@
settings->setUsesEncodingDetector([preferences usesEncodingDetector]);
settings->setFantasyFontFamily([preferences fantasyFontFamily]);
settings->setFixedFontFamily([preferences fixedFontFamily]);
+ settings->setScreenFontSubstitutionEnabled([preferences screenFontSubstitutionEnabled]);
settings->setForceFTPDirectoryListings([preferences _forceFTPDirectoryListings]);
settings->setFTPDirectoryTemplatePath([preferences _ftpDirectoryTemplatePath]);
settings->setLocalStorageDatabasePath([preferences _localStorageDatabasePath]);
Modified: trunk/Source/WebKit2/ChangeLog (129096 => 129097)
--- trunk/Source/WebKit2/ChangeLog 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebKit2/ChangeLog 2012-09-20 06:55:54 UTC (rev 129097)
@@ -1,3 +1,20 @@
+2012-09-19 Dan Bernstein <[email protected]>
+
+ WebKit2 part of adding a setting and API for disabling screen font substitution
+ https://bugs.webkit.org/show_bug.cgi?id=97168
+
+ Reviewed by Tim Horton.
+
+ * Shared/WebPreferencesStore.h:
+ (WebKit): Defined ScreenFontSubstitutionEnabled key with a default value of true.
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesSetScreenFontSubstitutionEnabled): Added this setter.
+ (WKPreferencesGetScreenFontSubstitutionEnabled): Added this getter.
+ * UIProcess/API/C/WKPreferencesPrivate.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences): Added a call to Settings::setScreenFontSubstitutionEnabled
+ to push the preference into Settings.
+
2012-09-19 Jinwoo Song <[email protected]>
Fix unused parameter compile warnings in WebKit/WebKit2
Modified: trunk/Source/WebKit2/Shared/WebPreferencesStore.h (129096 => 129097)
--- trunk/Source/WebKit2/Shared/WebPreferencesStore.h 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebKit2/Shared/WebPreferencesStore.h 2012-09-20 06:55:54 UTC (rev 129097)
@@ -128,6 +128,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) \
\
#define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (129096 => 129097)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp 2012-09-20 06:55:54 UTC (rev 129097)
@@ -288,6 +288,16 @@
return toImpl(preferencesRef)->minimumFontSize();
}
+void WKPreferencesSetScreenFontSubstitutionEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setScreenFontSubstitutionEnabled(enabled);
+}
+
+bool WKPreferencesGetScreenFontSubstitutionEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->screenFontSubstitutionEnabled();
+}
+
void WKPreferencesSetEditableLinkBehavior(WKPreferencesRef preferencesRef, WKEditableLinkBehavior wkBehavior)
{
toImpl(preferencesRef)->setEditableLinkBehavior(toEditableLinkBehavior(wkBehavior));
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h (129096 => 129097)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h 2012-09-20 06:55:54 UTC (rev 129097)
@@ -215,6 +215,10 @@
WK_EXPORT void WKPreferencesSetScrollingPerformanceLoggingEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetScrollingPerformanceLoggingEnabled(WKPreferencesRef preferencesRef);
+// Defaults to true
+WK_EXPORT void WKPreferencesSetScreenFontSubstitutionEnabled(WKPreferencesRef preferences, bool enabled);
+WK_EXPORT bool WKPreferencesGetScreenFontSubstitutionEnabled(WKPreferencesRef preferences);
+
WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef);
#ifdef __cplusplus
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (129096 => 129097)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-09-20 06:52:56 UTC (rev 129096)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-09-20 06:55:54 UTC (rev 129097)
@@ -2056,6 +2056,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->setLayoutFallbackWidth(store.getUInt32ValueForKey(WebPreferencesKey::layoutFallbackWidthKey()));
settings->setDeviceWidth(store.getUInt32ValueForKey(WebPreferencesKey::deviceWidthKey()));
settings->setDeviceHeight(store.getUInt32ValueForKey(WebPreferencesKey::deviceHeightKey()));