Diff
Modified: trunk/LayoutTests/ChangeLog (241267 => 241268)
--- trunk/LayoutTests/ChangeLog 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/LayoutTests/ChangeLog 2019-02-11 18:22:18 UTC (rev 241268)
@@ -1,3 +1,15 @@
+2019-02-11 Truitt Savell <[email protected]>
+
+ Unreviewed, rolling out r241229.
+
+ Revision broke internal builds for watchOS.
+
+ Reverted changeset:
+
+ "[Cocoa] Ask platform for generic font family mappings"
+ https://bugs.webkit.org/show_bug.cgi?id=187723
+ https://trac.webkit.org/changeset/241229
+
2019-02-11 Youenn Fablet <[email protected]>
Make Request constructor throw if FetchRequestInit.signal is not undefined, null or an AbortSignal object
Copied: trunk/LayoutTests/fast/text/international/font-fallback-to-common-script-expected.html (from rev 241267, trunk/LayoutTests/fast/text/international/locale-sensitive-fonts-expected.html) (0 => 241268)
--- trunk/LayoutTests/fast/text/international/font-fallback-to-common-script-expected.html (rev 0)
+++ trunk/LayoutTests/fast/text/international/font-fallback-to-common-script-expected.html 2019-02-11 18:22:18 UTC (rev 241268)
@@ -0,0 +1,8 @@
+<html>
+<body>
+<div style="font-size: 20px">
+<div style="font-family: 'Ahem'">this is ahem font</div>
+<div style="font-family: 'Ahem'">this is ahem font</div>
+</div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/text/international/font-fallback-to-common-script.html (0 => 241268)
--- trunk/LayoutTests/fast/text/international/font-fallback-to-common-script.html (rev 0)
+++ trunk/LayoutTests/fast/text/international/font-fallback-to-common-script.html 2019-02-11 18:22:18 UTC (rev 241268)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals) {
+ window.internals.settings.setStandardFontFamily("Times", "Hans");
+ window.internals.settings.setStandardFontFamily("", "Hans");
+ window.internals.settings.setStandardFontFamily("Ahem", "Zyyy");
+
+ window.internals.settings.setSansSerifFontFamily("Ahem", "Zyyy");
+
+ window.internals.setUserPreferredLanguages("en", "zh-cn");
+}
+</script>
+</head>
+<body>
+<!-- Test for font fallback to the common script when the per-script font setting is missing or the empty string.
+Bug 81329 <https://bugs.webkit.org/show_bug.cgi?id=81329> -->
+<div style="font-size: 20px">
+<div lang="zh-CN">this is ahem font</div>
+
+<!-- Test fallback to common script when no setting is set. This assumes there is no setting for "Zxxx" (script code for unwritten languages). -->
+<div lang="und-Zxxx" style="font-family: sans-serif;">this is ahem font</div>
+</div>
+</body>
+</html>
Modified: trunk/LayoutTests/fast/text/international/lang-sensitive-fonts-expected.html (241267 => 241268)
--- trunk/LayoutTests/fast/text/international/lang-sensitive-fonts-expected.html 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/LayoutTests/fast/text/international/lang-sensitive-fonts-expected.html 2019-02-11 18:22:18 UTC (rev 241268)
@@ -4,6 +4,7 @@
<div style="font-family: 'Ahem'">this is ahem font</div>
<div style="font-family: 'Ahem'">this is ahem font</div>
<div style="font-family: 'Ahem'">this is ahem font</div>
+<div style="font-family: 'Ahem'">this is ahem font</div>
<div>this is not ahem font</div>
</div>
</body>
Modified: trunk/LayoutTests/fast/text/international/lang-sensitive-fonts-xml-expected.html (241267 => 241268)
--- trunk/LayoutTests/fast/text/international/lang-sensitive-fonts-xml-expected.html 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/LayoutTests/fast/text/international/lang-sensitive-fonts-xml-expected.html 2019-02-11 18:22:18 UTC (rev 241268)
@@ -5,6 +5,7 @@
<div>this is ahem font</div>
<div>this is ahem font</div>
<div>this is ahem font</div>
+<div>this is ahem font</div>
</div>
</body>
</html>
Modified: trunk/LayoutTests/fast/text/international/lang-sensitive-fonts-xml.xhtml (241267 => 241268)
--- trunk/LayoutTests/fast/text/international/lang-sensitive-fonts-xml.xhtml 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/LayoutTests/fast/text/international/lang-sensitive-fonts-xml.xhtml 2019-02-11 18:22:18 UTC (rev 241268)
@@ -21,10 +21,14 @@
<div style="font-family: 'Ahem'">this is ahem font</div>
<div lang="zh-CN">this is ahem font</div>
<div id="target1" lang="ar">this is ahem font</div>
+<div id="target2" lang="ar" style="font-family: sans-serif">this is ahem font</div>
<div xml:lang="zh-CN">this is ahem font</div>
</div>
<script>
document.getElementById("target1").lang = "zh-CN";
+
+document.getElementById("target2").lang = "zh-CN";
+document.getElementById("target2").style.fontFamily = "fantasy";
</script>
</body>
</html>
Modified: trunk/LayoutTests/fast/text/international/lang-sensitive-fonts.html (241267 => 241268)
--- trunk/LayoutTests/fast/text/international/lang-sensitive-fonts.html 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/LayoutTests/fast/text/international/lang-sensitive-fonts.html 2019-02-11 18:22:18 UTC (rev 241268)
@@ -20,10 +20,14 @@
<div style="font-family: 'Ahem'">this is ahem font</div>
<div lang="zh-CN">this is ahem font</div>
<div id="target1" lang="ar">this is ahem font</div>
+<div id="target2" lang="ar" style="font-family: sans-serif">this is ahem font</div>
<div xml:lang="zh-CN">this is not ahem font</div>
</div>
<script>
document.getElementById("target1").lang = "zh-CN";
+
+document.getElementById("target2").lang = "zh-CN";
+document.getElementById("target2").style.fontFamily = "fantasy";
</script>
</body>
</html>
Modified: trunk/LayoutTests/fast/text/international/locale-sensitive-fonts-expected.html (241267 => 241268)
--- trunk/LayoutTests/fast/text/international/locale-sensitive-fonts-expected.html 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/LayoutTests/fast/text/international/locale-sensitive-fonts-expected.html 2019-02-11 18:22:18 UTC (rev 241268)
@@ -6,6 +6,7 @@
<div style="font-size: 20px">
<div style="font-family: 'Ahem'">this is ahem font</div>
<div style="font-family: 'Ahem'">this is ahem font</div>
+<div style="font-family: 'Ahem'">this is ahem font</div>
</div>
</body>
</html>
Modified: trunk/LayoutTests/fast/text/international/locale-sensitive-fonts.html (241267 => 241268)
--- trunk/LayoutTests/fast/text/international/locale-sensitive-fonts.html 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/LayoutTests/fast/text/international/locale-sensitive-fonts.html 2019-02-11 18:22:18 UTC (rev 241268)
@@ -16,6 +16,7 @@
<div style="font-size: 20px">
<div style="font-family: 'Ahem'">this is ahem font</div>
<div style="-webkit-locale: 'zh_CN'">this is ahem font</div>
+<div style="-webkit-locale: 'zh_CN'; font-family: fantasy">this is ahem font</div>
</div>
</body>
</html>
Deleted: trunk/LayoutTests/fast/text/ja-sans-serif-expected-mismatch.html (241267 => 241268)
--- trunk/LayoutTests/fast/text/ja-sans-serif-expected-mismatch.html 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/LayoutTests/fast/text/ja-sans-serif-expected-mismatch.html 2019-02-11 18:22:18 UTC (rev 241268)
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-</head>
-<body>
-<div lang="ja" style="font: 48px serif;">かくれキリシ</div>
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/text/ja-sans-serif.html (241267 => 241268)
--- trunk/LayoutTests/fast/text/ja-sans-serif.html 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/LayoutTests/fast/text/ja-sans-serif.html 2019-02-11 18:22:18 UTC (rev 241268)
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-</head>
-<body>
-<div lang="ja" style="font: 48px sans-serif;">かくれキリシ</div>
-</body>
-</html>
Modified: trunk/LayoutTests/platform/ios/fast/block/float/016-expected.txt (241267 => 241268)
--- trunk/LayoutTests/platform/ios/fast/block/float/016-expected.txt 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/LayoutTests/platform/ios/fast/block/float/016-expected.txt 2019-02-11 18:22:18 UTC (rev 241268)
@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
-layer at (0,0) size 800x512
- RenderBlock {HTML} at (0,0) size 800x513
- RenderBody {BODY} at (8,8) size 784x489
+layer at (0,0) size 800x511
+ RenderBlock {HTML} at (0,0) size 800x512
+ RenderBody {BODY} at (8,8) size 784x488
RenderBlock {UL} at (185,0) size 414x192
RenderListItem {LI} at (0,48) size 284x72
RenderBlock {A} at (123,0) size 161x139 [color=#CCCCCC]
@@ -62,6 +62,6 @@
RenderBlock {SPAN} at (8,61) size 144x21 [color=#000000]
RenderText {#text} at (59,0) size 26x20
text run at (59,0) width 26: "exit"
- RenderBlock {P} at (0,403) size 784x86
- RenderText {#text} at (331,32) size 122x21
- text run at (331,32) width 122: "Ceci n'est pas Flash."
+ RenderBlock {P} at (0,403) size 784x85
+ RenderText {#text} at (327,32) size 130x19
+ text run at (327,32) width 130: "Ceci n'est pas Flash."
Modified: trunk/Source/WTF/ChangeLog (241267 => 241268)
--- trunk/Source/WTF/ChangeLog 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WTF/ChangeLog 2019-02-11 18:22:18 UTC (rev 241268)
@@ -1,3 +1,15 @@
+2019-02-11 Truitt Savell <[email protected]>
+
+ Unreviewed, rolling out r241229.
+
+ Revision broke internal builds for watchOS.
+
+ Reverted changeset:
+
+ "[Cocoa] Ask platform for generic font family mappings"
+ https://bugs.webkit.org/show_bug.cgi?id=187723
+ https://trac.webkit.org/changeset/241229
+
2019-02-10 Darin Adler <[email protected]>
Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
Modified: trunk/Source/WTF/wtf/Platform.h (241267 => 241268)
--- trunk/Source/WTF/wtf/Platform.h 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WTF/wtf/Platform.h 2019-02-11 18:22:18 UTC (rev 241268)
@@ -1498,9 +1498,3 @@
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
#define HAVE_CSCHECKFIXDISABLE 1
#endif
-
-#if PLATFORM(MAC)
-#define ENABLE_MONOSPACE_FONT_EXCEPTION (__MAC_OS_X_VERSION_MIN_REQUIRED < 101500)
-#elif PLATFORM(IOS_FAMILY)
-#define ENABLE_MONOSPACE_FONT_EXCEPTION (__IPHONE_OS_VERSION_MIN_REQUIRED < 130000)
-#endif
Modified: trunk/Source/WebCore/ChangeLog (241267 => 241268)
--- trunk/Source/WebCore/ChangeLog 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/ChangeLog 2019-02-11 18:22:18 UTC (rev 241268)
@@ -1,3 +1,15 @@
+2019-02-11 Truitt Savell <[email protected]>
+
+ Unreviewed, rolling out r241229.
+
+ Revision broke internal builds for watchOS.
+
+ Reverted changeset:
+
+ "[Cocoa] Ask platform for generic font family mappings"
+ https://bugs.webkit.org/show_bug.cgi?id=187723
+ https://trac.webkit.org/changeset/241229
+
2019-02-11 Youenn Fablet <[email protected]>
Make Request constructor throw if FetchRequestInit.signal is not undefined, null or an AbortSignal object
Modified: trunk/Source/WebCore/PAL/ChangeLog (241267 => 241268)
--- trunk/Source/WebCore/PAL/ChangeLog 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/PAL/ChangeLog 2019-02-11 18:22:18 UTC (rev 241268)
@@ -1,3 +1,15 @@
+2019-02-11 Truitt Savell <[email protected]>
+
+ Unreviewed, rolling out r241229.
+
+ Revision broke internal builds for watchOS.
+
+ Reverted changeset:
+
+ "[Cocoa] Ask platform for generic font family mappings"
+ https://bugs.webkit.org/show_bug.cgi?id=187723
+ https://trac.webkit.org/changeset/241229
+
2019-02-08 Myles C. Maxfield <[email protected]>
[Cocoa] Ask platform for generic font family mappings
Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h (241267 => 241268)
--- trunk/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h 2019-02-11 18:22:18 UTC (rev 241268)
@@ -79,13 +79,6 @@
extern const CFStringRef kCTFontUserInstalledAttribute;
extern const CFStringRef kCTFontFallbackOptionAttribute;
-extern const CFStringRef kCTFontCSSFamilySerif;
-extern const CFStringRef kCTFontCSSFamilySansSerif;
-extern const CFStringRef kCTFontCSSFamilyCursive;
-extern const CFStringRef kCTFontCSSFamilyFantasy;
-extern const CFStringRef kCTFontCSSFamilyMonospace;
-extern const CFStringRef kCTFontCSSFamilySystemUI;
-
bool CTFontTransformGlyphs(CTFontRef, CGGlyph glyphs[], CGSize advances[], CFIndex count, CTFontTransformOptions);
CGSize CTRunGetInitialAdvance(CTRunRef);
@@ -94,7 +87,6 @@
CTTypesetterRef CTTypesetterCreateWithUniCharProviderAndOptions(CTUniCharProviderCallback, CTUniCharDisposeCallback, void* refCon, CFDictionaryRef options);
bool CTFontGetVerticalGlyphsForCharacters(CTFontRef, const UniChar characters[], CGGlyph glyphs[], CFIndex count);
void CTFontGetUnsummedAdvancesForGlyphsAndStyle(CTFontRef, CTFontOrientation, CGFontRenderingStyle, const CGGlyph[], CGSize advances[], CFIndex count);
-CTFontDescriptorRef CTFontDescriptorCreateForCSSFamily(CFStringRef cssFamily, CFStringRef language);
CTFontDescriptorRef CTFontDescriptorCreateForUIType(CTFontUIFontType, CGFloat size, CFStringRef language);
CTFontDescriptorRef CTFontDescriptorCreateWithTextStyle(CFStringRef style, CFStringRef size, CFStringRef language);
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (241267 => 241268)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2019-02-11 18:22:18 UTC (rev 241268)
@@ -1720,6 +1720,7 @@
return style->fontDescription().useFixedDefaultSize();
}
+
static CSSValueID identifierForFamily(const AtomicString& family)
{
if (family == cursiveFamily)
Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (241267 => 241268)
--- trunk/Source/WebCore/css/CSSFontSelector.cpp 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp 2019-02-11 18:22:18 UTC (rev 241268)
@@ -274,12 +274,8 @@
dispatchInvalidationCallbacks();
}
-static AtomicString resolveGenericFamily(Document* document, const FontDescription& fontDescription, const AtomicString& familyName)
+static const AtomicString& resolveGenericFamily(Document* document, const FontDescription& fontDescription, const AtomicString& familyName)
{
- auto platformResult = FontDescription::platformResolveGenericFamily(fontDescription.script(), fontDescription.locale(), familyName);
- if (!platformResult.isNull())
- return platformResult;
-
if (!document)
return familyName;
Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (241267 => 241268)
--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp 2019-02-11 18:22:18 UTC (rev 241268)
@@ -1067,13 +1067,16 @@
{
RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
do {
- if (auto parsedValue = consumeGenericFamily(range))
+ RefPtr<CSSValue> parsedValue = consumeGenericFamily(range);
+ if (parsedValue) {
list->append(parsedValue.releaseNonNull());
- else {
- if (auto parsedValue = consumeFamilyName(range))
+ } else {
+ parsedValue = consumeFamilyName(range);
+ if (parsedValue) {
list->append(parsedValue.releaseNonNull());
- else
+ } else {
return nullptr;
+ }
}
} while (consumeCommaIncludingWhitespace(range));
return list;
Modified: trunk/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm (241267 => 241268)
--- trunk/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm 2019-02-11 18:22:18 UTC (rev 241268)
@@ -48,12 +48,41 @@
#if PLATFORM(MAC)
+static bool osakaMonoIsInstalled()
+{
+ int _one_ = 1;
+ RetainPtr<CFNumberRef> yes = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &one));
+ CFTypeRef keys[] = { kCTFontEnabledAttribute, kCTFontNameAttribute };
+ CFTypeRef values[] = { yes.get(), CFSTR("Osaka-Mono") };
+ RetainPtr<CFDictionaryRef> attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(values), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+ RetainPtr<CTFontDescriptorRef> descriptor = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get()));
+ RetainPtr<CFSetRef> mandatoryAttributes = adoptCF(CFSetCreate(kCFAllocatorDefault, keys, WTF_ARRAY_LENGTH(keys), &kCFTypeSetCallBacks));
+ return adoptCF(CTFontDescriptorCreateMatchingFontDescriptor(descriptor.get(), mandatoryAttributes.get()));
+}
+
void SettingsBase::initializeDefaultFontFamilies()
{
setStandardFontFamily("Songti TC", USCRIPT_TRADITIONAL_HAN);
+ setSerifFontFamily("Songti TC", USCRIPT_TRADITIONAL_HAN);
+ setFixedFontFamily(sansSerifTraditionalHanFontFamily(), USCRIPT_TRADITIONAL_HAN);
+ setSansSerifFontFamily(sansSerifTraditionalHanFontFamily(), USCRIPT_TRADITIONAL_HAN);
+ setCursiveFontFamily("Kaiti TC", USCRIPT_TRADITIONAL_HAN);
+
setStandardFontFamily("Songti SC", USCRIPT_SIMPLIFIED_HAN);
+ setSerifFontFamily("Songti SC", USCRIPT_SIMPLIFIED_HAN);
+ setFixedFontFamily(sansSerifSimplifiedHanFontFamily(), USCRIPT_SIMPLIFIED_HAN);
+ setSansSerifFontFamily(sansSerifSimplifiedHanFontFamily(), USCRIPT_SIMPLIFIED_HAN);
+ setCursiveFontFamily("Kaiti SC", USCRIPT_SIMPLIFIED_HAN);
+
setStandardFontFamily("Hiragino Mincho ProN", USCRIPT_KATAKANA_OR_HIRAGANA);
+ setFixedFontFamily(osakaMonoIsInstalled() ? "Osaka-Mono" : "Hiragino Sans", USCRIPT_KATAKANA_OR_HIRAGANA);
+ setSerifFontFamily("Hiragino Mincho ProN", USCRIPT_KATAKANA_OR_HIRAGANA);
+ setSansSerifFontFamily("Hiragino Kaku Gothic ProN", USCRIPT_KATAKANA_OR_HIRAGANA);
+
setStandardFontFamily("AppleMyungjo", USCRIPT_HANGUL);
+ setSerifFontFamily("AppleMyungjo", USCRIPT_HANGUL);
+ setFixedFontFamily("Apple SD Gothic Neo", USCRIPT_HANGUL);
+ setSansSerifFontFamily("Apple SD Gothic Neo", USCRIPT_HANGUL);
setStandardFontFamily("Times", USCRIPT_COMMON);
setFixedFontFamily("Courier", USCRIPT_COMMON);
@@ -70,10 +99,28 @@
void SettingsBase::initializeDefaultFontFamilies()
{
+ // There is no serif Chinese font in default iOS installation.
setStandardFontFamily(sansSerifTraditionalHanFontFamily(), USCRIPT_TRADITIONAL_HAN);
+ setSerifFontFamily(sansSerifTraditionalHanFontFamily(), USCRIPT_TRADITIONAL_HAN);
+ setFixedFontFamily(sansSerifTraditionalHanFontFamily(), USCRIPT_TRADITIONAL_HAN);
+ setSansSerifFontFamily(sansSerifTraditionalHanFontFamily(), USCRIPT_TRADITIONAL_HAN);
+
+ // There is no serif Chinese font in default iOS installation.
setStandardFontFamily(sansSerifSimplifiedHanFontFamily(), USCRIPT_SIMPLIFIED_HAN);
+ setSerifFontFamily(sansSerifSimplifiedHanFontFamily(), USCRIPT_SIMPLIFIED_HAN);
+ setFixedFontFamily(sansSerifSimplifiedHanFontFamily(), USCRIPT_SIMPLIFIED_HAN);
+ setSansSerifFontFamily(sansSerifSimplifiedHanFontFamily(), USCRIPT_SIMPLIFIED_HAN);
+
setStandardFontFamily("Hiragino Mincho ProN", USCRIPT_KATAKANA_OR_HIRAGANA);
+ setFixedFontFamily("Hiragino Kaku Gothic ProN", USCRIPT_KATAKANA_OR_HIRAGANA);
+ setSerifFontFamily("Hiragino Mincho ProN", USCRIPT_KATAKANA_OR_HIRAGANA);
+ setSansSerifFontFamily("Hiragino Kaku Gothic ProN", USCRIPT_KATAKANA_OR_HIRAGANA);
+
+ // There is no serif Korean font in default iOS installation.
setStandardFontFamily("Apple SD Gothic Neo", USCRIPT_HANGUL);
+ setSerifFontFamily("Apple SD Gothic Neo", USCRIPT_HANGUL);
+ setFixedFontFamily("Apple SD Gothic Neo", USCRIPT_HANGUL);
+ setSansSerifFontFamily("Apple SD Gothic Neo", USCRIPT_HANGUL);
setStandardFontFamily("Times", USCRIPT_COMMON);
setFixedFontFamily("Courier", USCRIPT_COMMON);
Modified: trunk/Source/WebCore/platform/graphics/FontDescription.cpp (241267 => 241268)
--- trunk/Source/WebCore/platform/graphics/FontDescription.cpp 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.cpp 2019-02-11 18:22:18 UTC (rev 241268)
@@ -71,11 +71,4 @@
m_script = localeToScriptCodeForFontSelection(m_locale);
}
-#if !PLATFORM(COCOA)
-AtomicString FontDescription::platformResolveGenericFamily(UScriptCode, const AtomicString&, const AtomicString&)
-{
- return nullAtom();
-}
-#endif
-
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/FontDescription.h (241267 => 241268)
--- trunk/Source/WebCore/platform/graphics/FontDescription.h 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.h 2019-02-11 18:22:18 UTC (rev 241268)
@@ -133,8 +133,6 @@
void setFontStyleAxis(FontStyleAxis axis) { m_fontStyleAxis = axis == FontStyleAxis::ital; }
void setShouldAllowUserInstalledFonts(AllowUserInstalledFonts shouldAllowUserInstalledFonts) { m_shouldAllowUserInstalledFonts = static_cast<unsigned>(shouldAllowUserInstalledFonts); }
- static AtomicString platformResolveGenericFamily(UScriptCode, const AtomicString& locale, const AtomicString& familyName);
-
private:
// FIXME: Investigate moving these into their own object on the heap (to save memory).
FontFeatureSettings m_featureSettings;
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp (241267 => 241268)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp 2019-02-11 18:22:18 UTC (rev 241268)
@@ -27,8 +27,6 @@
#include "FontDescription.h"
#include "SystemFontDatabaseCoreText.h"
-#include <mutex>
-#include <wtf/Language.h>
#if USE_PLATFORM_SYSTEM_FALLBACK_LIST
@@ -140,58 +138,7 @@
return nullAtom();
}
-static String computeSpecializedChineseLocale()
-{
- const Vector<String>& preferredLanguages = userPreferredLanguages();
- for (auto& language : preferredLanguages) {
- if (equalIgnoringASCIICase(language, "zh") || startsWithLettersIgnoringASCIICase(language, "zh-"))
- return language;
- }
- return "zh-hans"_str; // We have no signal. Pick one option arbitrarily.
}
-static String& cachedSpecializedChineseLocale()
-{
- static NeverDestroyed<String> specializedChineseLocale;
- return specializedChineseLocale.get();
-}
-
-static void languageChanged(void*)
-{
- cachedSpecializedChineseLocale() = computeSpecializedChineseLocale();
-}
-
-AtomicString FontDescription::platformResolveGenericFamily(UScriptCode script, const AtomicString& locale, const AtomicString& familyName)
-{
- if (script == USCRIPT_COMMON)
- return nullAtom();
-
- static std::once_flag onceFlag;
- std::call_once(onceFlag, [&] {
- static int dummy;
- addLanguageChangeObserver(&dummy, &languageChanged); // We will never remove the observer, so all we need is a non-null pointer.
- languageChanged(nullptr);
- });
-
- // FIXME: Delete this once <rdar://problem/47682577> is fixed.
- auto& usedLocale = script == USCRIPT_HAN ? cachedSpecializedChineseLocale() : locale.string();
-
- // FIXME: Use the system font database to handle standardFamily
- if (familyName == serifFamily)
- return SystemFontDatabaseCoreText::singleton().serifFamily(usedLocale);
- if (familyName == sansSerifFamily)
- return SystemFontDatabaseCoreText::singleton().sansSerifFamily(usedLocale);
- if (familyName == cursiveFamily)
- return SystemFontDatabaseCoreText::singleton().cursiveFamily(usedLocale);
- if (familyName == fantasyFamily)
- return SystemFontDatabaseCoreText::singleton().fantasyFamily(usedLocale);
- if (familyName == monospaceFamily)
- return SystemFontDatabaseCoreText::singleton().monospaceFamily(usedLocale);
-
- return nullAtom();
-}
-
-}
-
#endif
Modified: trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp (241267 => 241268)
--- trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp 2019-02-11 18:22:18 UTC (rev 241268)
@@ -80,11 +80,6 @@
void SystemFontDatabaseCoreText::clear()
{
m_systemFontCache.clear();
- m_serifFamilies.clear();
- m_sansSeriferifFamilies.clear();
- m_cursiveFamilies.clear();
- m_fantasyFamilies.clear();
- m_monospaceFamilies.clear();
}
RetainPtr<CTFontRef> SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior(CTFontRef font, CGFloat weight, bool italic, float size, AllowUserInstalledFonts allowUserInstalledFonts)
@@ -177,56 +172,6 @@
return cascadeList(systemFontParameters(description, cssFamily, clientUse, allowUserInstalledFonts), clientUse);
}
-String SystemFontDatabaseCoreText::serifFamily(const String& locale)
-{
- return m_serifFamilies.ensure(locale, [&] {
- auto descriptor = adoptCF(CTFontDescriptorCreateForCSSFamily(kCTFontCSSFamilySerif, locale.createCFString().get()));
- return adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(descriptor.get(), kCTFontFamilyNameAttribute))).get();
- }).iterator->value;
}
-String SystemFontDatabaseCoreText::sansSerifFamily(const String& locale)
-{
- return m_sansSeriferifFamilies.ensure(locale, [&] {
- auto descriptor = adoptCF(CTFontDescriptorCreateForCSSFamily(kCTFontCSSFamilySansSerif, locale.createCFString().get()));
- return adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(descriptor.get(), kCTFontFamilyNameAttribute))).get();
- }).iterator->value;
-}
-
-String SystemFontDatabaseCoreText::cursiveFamily(const String& locale)
-{
- return m_cursiveFamilies.ensure(locale, [&] {
- auto descriptor = adoptCF(CTFontDescriptorCreateForCSSFamily(kCTFontCSSFamilyCursive, locale.createCFString().get()));
- return adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(descriptor.get(), kCTFontFamilyNameAttribute))).get();
- }).iterator->value;
-}
-
-String SystemFontDatabaseCoreText::fantasyFamily(const String& locale)
-{
- return m_fantasyFamilies.ensure(locale, [&] {
- auto descriptor = adoptCF(CTFontDescriptorCreateForCSSFamily(kCTFontCSSFamilyFantasy, locale.createCFString().get()));
- return adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(descriptor.get(), kCTFontFamilyNameAttribute))).get();
- }).iterator->value;
-}
-
-String SystemFontDatabaseCoreText::monospaceFamily(const String& locale)
-{
- return m_monospaceFamilies.ensure(locale, [&] {
- auto descriptor = adoptCF(CTFontDescriptorCreateForCSSFamily(kCTFontCSSFamilyMonospace, locale.createCFString().get()));
- String result = adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(descriptor.get(), kCTFontFamilyNameAttribute))).get();
-#if PLATFORM(MAC) && ENABLE(MONOSPACE_FONT_EXCEPTION)
- // In general, CoreText uses Monaco for monospaced (see: Terminal.app and Xcode.app).
- // For now, we want to use Courier for web compatibility, until we have more time to do compatibility testing.
- if (equalLettersIgnoringASCIICase(result, "monaco"))
- return "Courier"_str;
-#elif PLATFORM(IOS_FAMILY) && ENABLE(MONOSPACE_FONT_EXCEPTION)
- if (equalLettersIgnoringASCIICase(result, "courier new"))
- return "Courier"_str;
#endif
- return result;
- }).iterator->value;
-}
-
-}
-
-#endif
Modified: trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.h (241267 => 241268)
--- trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.h 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.h 2019-02-11 18:22:18 UTC (rev 241268)
@@ -101,13 +101,6 @@
enum class ClientUse { ForSystemUI, ForTextStyle };
Vector<RetainPtr<CTFontDescriptorRef>> cascadeList(const FontCascadeDescription&, const AtomicString& cssFamily, ClientUse, AllowUserInstalledFonts);
-
- String serifFamily(const String& locale);
- String sansSerifFamily(const String& locale);
- String cursiveFamily(const String& locale);
- String fantasyFamily(const String& locale);
- String monospaceFamily(const String& locale);
-
void clear();
private:
@@ -121,12 +114,6 @@
static CascadeListParameters systemFontParameters(const FontCascadeDescription&, const AtomicString& familyName, ClientUse, AllowUserInstalledFonts);
HashMap<CascadeListParameters, Vector<RetainPtr<CTFontDescriptorRef>>, CascadeListParameters::CascadeListParametersHash, SimpleClassHashTraits<CascadeListParameters>> m_systemFontCache;
-
- HashMap<String, String> m_serifFamilies;
- HashMap<String, String> m_sansSeriferifFamilies;
- HashMap<String, String> m_cursiveFamilies;
- HashMap<String, String> m_fantasyFamilies;
- HashMap<String, String> m_monospaceFamilies;
};
}
Modified: trunk/Tools/ChangeLog (241267 => 241268)
--- trunk/Tools/ChangeLog 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Tools/ChangeLog 2019-02-11 18:22:18 UTC (rev 241268)
@@ -1,3 +1,15 @@
+2019-02-11 Truitt Savell <[email protected]>
+
+ Unreviewed, rolling out r241229.
+
+ Revision broke internal builds for watchOS.
+
+ Reverted changeset:
+
+ "[Cocoa] Ask platform for generic font family mappings"
+ https://bugs.webkit.org/show_bug.cgi?id=187723
+ https://trac.webkit.org/changeset/241229
+
2019-02-11 Takashi Komori <[email protected]>
[WinCairo][MiniBrowser] Basic authentication always fails.
Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (241267 => 241268)
--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2019-02-11 18:22:18 UTC (rev 241268)
@@ -377,7 +377,6 @@
@"Hiragino Maru Gothic ProN",
@"Hiragino Mincho Pro",
@"Hiragino Mincho ProN",
- @"Hiragino Sans",
@"Hiragino Sans GB",
@"Hoefler Text",
@"Impact",
@@ -387,7 +386,6 @@
@"Kokonor",
@"Krungthep",
@"KufiStandardGK",
- @"Lao Sangam MN",
@"LastResort",
@"LiHei Pro",
@"LiSong Pro",
@@ -405,15 +403,11 @@
@"Papyrus",
@"PCMyungjo",
@"PilGi",
- @"PingFang HK",
- @"PingFang SC",
- @"PingFang TC",
@"Plantagenet Cherokee",
@"Raanana",
@"Sathu",
@"Silom",
@"Skia",
- @"Snell Roundhand",
@"Songti SC",
@"Songti TC",
@"STFangsong",
Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (241267 => 241268)
--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm 2019-02-11 18:10:25 UTC (rev 241267)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm 2019-02-11 18:22:18 UTC (rev 241268)
@@ -222,7 +222,6 @@
@"Hiragino Maru Gothic ProN",
@"Hiragino Mincho Pro",
@"Hiragino Mincho ProN",
- @"Hiragino Sans",
@"Hiragino Sans GB",
@"Hoefler Text",
@"Impact",
@@ -232,7 +231,6 @@
@"Kokonor",
@"Krungthep",
@"KufiStandardGK",
- @"Lao Sangam MN",
@"LastResort",
@"LiHei Pro",
@"LiSong Pro",
@@ -250,15 +248,11 @@
@"Papyrus",
@"PCMyungjo",
@"PilGi",
- @"PingFang HK",
- @"PingFang SC",
- @"PingFang TC",
@"Plantagenet Cherokee",
@"Raanana",
@"Sathu",
@"Silom",
@"Skia",
- @"Snell Roundhand",
@"Songti SC",
@"Songti TC",
@"STFangsong",