Diff
Modified: trunk/Source/WebCore/ChangeLog (266672 => 266673)
--- trunk/Source/WebCore/ChangeLog 2020-09-05 21:34:14 UTC (rev 266672)
+++ trunk/Source/WebCore/ChangeLog 2020-09-05 22:27:11 UTC (rev 266673)
@@ -1,5 +1,24 @@
2020-09-05 Myles C. Maxfield <[email protected]>
+ [iOS Family] Remove the concept of custom fallback fonts
+ https://bugs.webkit.org/show_bug.cgi?id=215690
+
+ Reviewed by Sam Weinig.
+
+ They're no longer necessary for iOS, and macOS doesn't
+ even have the concept of custom fallback fonts, so we
+ can just remove the entire concept.
+
+ * platform/graphics/FontCache.h:
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::FontCache::systemFallbackForCharacters):
+ * platform/graphics/cocoa/FontCacheCoreText.h:
+ * platform/graphics/ios/FontCacheIOS.mm:
+ (WebCore::requiresCustomFallbackFont): Deleted.
+ (WebCore::FontCache::getCustomFallbackFont): Deleted.
+
+2020-09-05 Myles C. Maxfield <[email protected]>
+
[Cocoa] USE(PLATFORM_SYSTEM_FALLBACK_LIST) is true on all Cocoa platforms, so there's no need to consult it in Cocoa-specific files
https://bugs.webkit.org/show_bug.cgi?id=215684
Modified: trunk/Source/WebCore/SourcesCocoa.txt (266672 => 266673)
--- trunk/Source/WebCore/SourcesCocoa.txt 2020-09-05 21:34:14 UTC (rev 266672)
+++ trunk/Source/WebCore/SourcesCocoa.txt 2020-09-05 22:27:11 UTC (rev 266673)
@@ -395,7 +395,6 @@
platform/graphics/gpu/cocoa/GPUTextureMetal.mm
platform/graphics/gpu/cocoa/GPUUtilsMetal.mm
platform/graphics/ios/DisplayRefreshMonitorIOS.mm
-platform/graphics/ios/FontCacheIOS.mm
platform/graphics/ios/IconIOS.mm
platform/graphics/mac/ColorMac.mm
platform/graphics/mac/ComplexTextControllerCoreText.mm
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (266672 => 266673)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-09-05 21:34:14 UTC (rev 266672)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-09-05 22:27:11 UTC (rev 266673)
@@ -7342,7 +7342,6 @@
371F51A00D262FA000ECE0D5 /* CSSSegmentedFontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSSegmentedFontFace.cpp; sourceTree = "<group>"; };
371F53E70D2704F900ECE0D5 /* CSSUnicodeRangeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSUnicodeRangeValue.h; sourceTree = "<group>"; };
371F53E80D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSUnicodeRangeValue.cpp; sourceTree = "<group>"; };
- 3727DFD4142AAE4500D449CB /* FontCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FontCacheIOS.mm; sourceTree = "<group>"; };
372ADA37197F47B900FC501E /* ProtectionSpaceCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtectionSpaceCocoa.h; sourceTree = "<group>"; };
372ADA39197F687600FC501E /* ProtectionSpaceCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProtectionSpaceCocoa.mm; sourceTree = "<group>"; };
372C00C3129611F1005C9575 /* TextBoundaries.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBoundaries.cpp; sourceTree = "<group>"; };
@@ -17466,11 +17465,11 @@
6FB2400323DFF12700796458 /* InlineLineBox.h */,
6FE198132178397B00446F08 /* InlineLineBreaker.cpp */,
6FE198152178397C00446F08 /* InlineLineBreaker.h */,
+ 6F25B200220A85AB0000011B /* InlineLineBuilder.cpp */,
+ 6F26EB46234004A5006906E2 /* InlineLineBuilder.h */,
6F360E4E23999420001512A7 /* InlineSoftLineBreakItem.h */,
6F1CC1DC225F8B4100720AD2 /* InlineTextItem.cpp */,
6F1CC1DD225F8B4200720AD2 /* InlineTextItem.h */,
- 6F25B200220A85AB0000011B /* InlineLineBuilder.cpp */,
- 6F26EB46234004A5006906E2 /* InlineLineBuilder.h */,
);
path = inlineformatting;
sourceTree = "<group>";
@@ -19170,7 +19169,6 @@
2D29ECC9192F1F1D00984B78 /* DisplayRefreshMonitorIOS.h */,
0F97A657155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm */,
1AC2D89C1B1E291F00D52E87 /* FontAntialiasingStateSaver.h */,
- 3727DFD4142AAE4500D449CB /* FontCacheIOS.mm */,
31AB4FFF122878A2001A7DB0 /* GraphicsContextGLOpenGLESIOS.h */,
FED13D3F0CEA939400D89466 /* IconIOS.mm */,
);
@@ -31651,6 +31649,7 @@
6F0CD695229ED32700C5994E /* InlineLine.h in Headers */,
6FB2400523DFF12800796458 /* InlineLineBox.h in Headers */,
6FE198172178397C00446F08 /* InlineLineBreaker.h in Headers */,
+ 6F26EB48234004A5006906E2 /* InlineLineBuilder.h in Headers */,
F45775CE241437D5002DF1A0 /* InlinePathData.h in Headers */,
6F360E5023999421001512A7 /* InlineSoftLineBreakItem.h in Headers */,
AA4C3A770B2B1679002334A2 /* InlineStyleSheetOwner.h in Headers */,
@@ -32662,7 +32661,6 @@
84730D911248F0B300D3A9C9 /* LightSource.h in Headers */,
B22279650D00BF220071B782 /* LinearGradientAttributes.h in Headers */,
AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */,
- 6F26EB48234004A5006906E2 /* InlineLineBuilder.h in Headers */,
FFEFAB2A18380DA000514534 /* LineLayoutState.h in Headers */,
E484A33E23055325009ADE6A /* LineLayoutTraversal.h in Headers */,
E4343D252392779000EBBB66 /* LineLayoutTraversalComplexPath.h in Headers */,
Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (266672 => 266673)
--- trunk/Source/WebCore/platform/graphics/FontCache.h 2020-09-05 21:34:14 UTC (rev 266672)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h 2020-09-05 22:27:11 UTC (rev 266673)
@@ -264,9 +264,6 @@
FontPlatformData* getCachedFontPlatformData(const FontDescription&, const AtomString& family, const FontFeatureSettings* fontFaceFeatures = nullptr, FontSelectionSpecifiedCapabilities fontFaceCapabilities = { }, bool checkingAlternateName = false);
// These methods are implemented by each platform.
-#if PLATFORM(COCOA)
- FontPlatformData* getCustomFallbackFont(const UInt32, const FontDescription&);
-#endif
WEBCORE_EXPORT std::unique_ptr<FontPlatformData> createFontPlatformData(const FontDescription&, const AtomString& family, const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities);
static const AtomString& alternateFamilyName(const AtomString&);
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (266672 => 266673)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2020-09-05 21:34:14 UTC (rev 266672)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2020-09-05 22:27:11 UTC (rev 266673)
@@ -1479,15 +1479,6 @@
RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, IsForPlatformFont isForPlatformFont, PreferColoredFont, const UChar* characters, unsigned length)
{
-#if PLATFORM(IOS_FAMILY)
- if (length && requiresCustomFallbackFont(*characters)) {
- auto* fallback = getCustomFallbackFont(*characters, description);
- if (!fallback)
- return nullptr;
- return fontForPlatformData(*fallback);
- }
-#endif
-
const FontPlatformData& platformData = originalFontData->platformData();
auto fullName = String(adoptCF(CTFontCopyFullName(platformData.font())).get());
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h (266672 => 266673)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h 2020-09-05 21:34:14 UTC (rev 266672)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h 2020-09-05 22:27:11 UTC (rev 266673)
@@ -53,7 +53,6 @@
RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, const FontDescription&, const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool applyWeightWidthSlopeVariations = true);
SynthesisPair computeNecessarySynthesis(CTFontRef, const FontDescription&, bool isPlatformFont = false);
RetainPtr<CTFontRef> platformFontWithFamily(const AtomString& family, FontSelectionRequest, TextRenderingMode, float size);
-bool requiresCustomFallbackFont(UChar32 character);
FontSelectionCapabilities capabilitiesForFontDescriptor(CTFontDescriptorRef);
void addAttributesForInstalledFonts(CFMutableDictionaryRef attributes, AllowUserInstalledFonts);
RetainPtr<CTFontRef> createFontForInstalledFonts(CTFontDescriptorRef, CGFloat size, AllowUserInstalledFonts);
Deleted: trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (266672 => 266673)
--- trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm 2020-09-05 21:34:14 UTC (rev 266672)
+++ trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm 2020-09-05 22:27:11 UTC (rev 266673)
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "FontCache.h"
-
-#if PLATFORM(IOS_FAMILY)
-
-#import "FontCascade.h"
-#import "RenderThemeIOS.h"
-#import "SystemFontDatabaseCoreText.h"
-#import <pal/spi/cg/CoreGraphicsSPI.h>
-#import <pal/spi/cocoa/CoreTextSPI.h>
-#import <wtf/HashSet.h>
-#import <wtf/NeverDestroyed.h>
-#import <wtf/RetainPtr.h>
-#import <wtf/SoftLinking.h>
-#import <wtf/text/CString.h>
-
-namespace WebCore {
-
-bool requiresCustomFallbackFont(UChar32 character)
-{
- return character == AppleLogo || character == narrowNonBreakingSpace;
-}
-
-FontPlatformData* FontCache::getCustomFallbackFont(const UInt32 c, const FontDescription& description)
-{
- ASSERT(requiresCustomFallbackFont(c));
-
- static MainThreadNeverDestroyed<const AtomString> helveticaFamily("Helvetica Neue", AtomString::ConstructFromLiteral);
- static MainThreadNeverDestroyed<const AtomString> timesNewRomanPSMTFamily("TimesNewRomanPSMT", AtomString::ConstructFromLiteral);
-
- const AtomString* family = nullptr;
- switch (c) {
- case AppleLogo:
- family = &helveticaFamily.get();
- break;
- case narrowNonBreakingSpace:
- family = ×NewRomanPSMTFamily.get();
- break;
- default:
- ASSERT_NOT_REACHED();
- return nullptr;
- }
- ASSERT(family);
- if (!family)
- return nullptr;
- return getCachedFontPlatformData(description, *family);
-}
-
-} // namespace WebCore
-
-#endif // PLATFORM(IOS_FAMILY)