Refactor user-installed font setting for clarity
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Dec 2017 03:24:15 +0000 (03:24 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Dec 2017 03:24:15 +0000 (03:24 +0000)
commita4205f4b640866ea581dc7bfa37615ef8e9586b9
treecd29cdd26bbff81ab9bb0d47d49d55cec54cad83
parent0dc1beba96fb7ef0e288ddd12552212ff16c8abd
Refactor user-installed font setting for clarity
https://bugs.webkit.org/show_bug.cgi?id=181013

Reviewed by Simon Fraser.

Source/WebCore:

Pave the way for https://bugs.webkit.org/show_bug.cgi?id=180951.

This patch renames the Setting to not have so many grammatical negatives, and moves
some CoreText-specific FontCache function signatures into a new FontCacheCoreText.h
header file. It also uses the AllowUserInstalledFonts enum class in more places instead
of the old boolean we were using, and puts this enum class in the common TextFlags.h
header.

No new tests because there is no behavior change.

* WebCore.xcodeproj/project.pbxproj:
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::initializeFontStyle):
* page/Settings.yaml:
* platform/graphics/FontCache.h:
(WebCore::SynthesisPair::SynthesisPair): Deleted.
(WebCore::SynthesisPair::boldObliquePair const): Deleted.
* platform/graphics/FontDescription.cpp:
(WebCore::m_shouldAllowUserInstalledFonts):
(WebCore::m_mayRepresentUserInstalledFont): Deleted.
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::shouldAllowUserInstalledFonts const):
(WebCore::FontDescription::setShouldAllowUserInstalledFonts):
(WebCore::FontDescription::operator== const):
(WebCore::FontDescription::mayRepresentUserInstalledFont const): Deleted.
(WebCore::FontDescription::setMayRepresentUserInstalledFont): Deleted.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::singleton):
(WebCore::FontDatabase::singletonAllowingUserInstalledFonts):
(WebCore::FontDatabase::singletonDisallowingUserInstalledFonts):
(WebCore::FontDatabase::FontDatabase):
(WebCore::platformFontLookupWithFamily):
(WebCore::fontWithFamily):
* platform/graphics/cocoa/FontCacheCoreText.h: Added.
(WebCore::SynthesisPair::SynthesisPair):
(WebCore::SynthesisPair::boldObliquePair const):
* platform/text/TextFlags.h:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):

Source/WebKit:

There are no clients of this SPI yet, so we can rename it to remove the
grammatical negative.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetShouldAllowUserInstalledFonts):
(WKPreferencesGetShouldAllowUserInstalledFonts):
(WKPreferencesSetShouldDisallowUserInstalledFonts): Deleted.
(WKPreferencesGetShouldDisallowUserInstalledFonts): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _shouldAllowUserInstalledFonts]):
(-[WKPreferences _setShouldAllowUserInstalledFonts:]):
(-[WKPreferences _shouldDisallowUserInstalledFonts]): Deleted.
(-[WKPreferences _setShouldDisallowUserInstalledFonts:]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

LayoutTests:

* fast/text/user-installed-fonts/disable.html:
* fast/text/user-installed-fonts/shadow-disable.html:
* fast/text/user-installed-fonts/shadow-family-disable.html:
* fast/text/user-installed-fonts/shadow-postscript-disable.html:
* fast/text/user-installed-fonts/shadow-postscript-family-disable.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226172 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text/user-installed-fonts/disable.html
LayoutTests/fast/text/user-installed-fonts/shadow-disable.html
LayoutTests/fast/text/user-installed-fonts/shadow-family-disable.html
LayoutTests/fast/text/user-installed-fonts/shadow-postscript-disable.html
LayoutTests/fast/text/user-installed-fonts/shadow-postscript-family-disable.html
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSFontFaceSet.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/page/Settings.yaml
Source/WebCore/platform/graphics/FontCache.h
Source/WebCore/platform/graphics/FontDescription.cpp
Source/WebCore/platform/graphics/FontDescription.h
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h [new file with mode: 0644]
Source/WebCore/platform/text/TextFlags.h
Source/WebCore/style/StyleResolveForDocument.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h