Title: [247377] trunk
Revision
247377
Author
mmaxfi...@apple.com
Date
2019-07-11 18:08:29 -0700 (Thu, 11 Jul 2019)

Log Message

New York font erroneously gets synthetic bold
https://bugs.webkit.org/show_bug.cgi?id=199653
<rdar://problem/51692592>

Reviewed by Simon Fraser.

Source/WebCore:

This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
to expose these fonts to the web because we don't a standardization story for them
yet, but we do want some apps to be able to use them.

WebKit clients who want to use these fonts can set
-[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.

The patch generalizes our existing system-ui infrastructure to handle these three
additional fonts. It also explicitly disables the unsupported dot-prefixed names
so they don't leak out into Web content.

Tests: fast/text/design-system-ui-10.html
       fast/text/design-system-ui-11.html
       fast/text/design-system-ui-12.html
       fast/text/design-system-ui-13.html
       fast/text/design-system-ui-14.html
       fast/text/design-system-ui-15.html
       fast/text/design-system-ui-16.html
       fast/text/design-system-ui-2.html
       fast/text/design-system-ui-3.html
       fast/text/design-system-ui-4.html
       fast/text/design-system-ui-5.html
       fast/text/design-system-ui-6.html
       fast/text/design-system-ui-7.html
       fast/text/design-system-ui-8.html
       fast/text/design-system-ui-9.html
       fast/text/design-system-ui.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
* css/CSSFontFace.h:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::initializeFontStyle):
* page/Settings.yaml:
* platform/graphics/FontDescription.cpp:
(WebCore::m_shouldAllowDesignSystemUIFonts):
(WebCore::m_shouldAllowUserInstalledFonts): Deleted.
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
(WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
(WebCore::FontDescription::operator== const):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::platformFontLookupWithFamily):
(WebCore::fontWithFamily):
* platform/graphics/cocoa/FontCacheCoreText.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::systemFontUse):
(WebCore::systemFontCascadeList):
(WebCore::FontCascadeDescription::effectiveFamilyCount const):
(WebCore::FontCascadeDescription::effectiveFamilyAt const):
(WebCore::isSystemFontString): Deleted.
(WebCore::isUIFontTextStyle): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::ctFont const):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::createSystemUI):
(WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
(WebCore::SystemFontDatabaseCoreText::createTextStyle):
(WebCore::SystemFontDatabaseCoreText::cascadeList):
(WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
(WebCore::SystemFontDatabaseCoreText::systemFontParameters):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebCore/PAL:

* pal/spi/cocoa/CoreTextSPI.h:

Source/WebKit:

Add the SPI to enable the new fonts.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetShouldAllowDesignSystemUIFonts):
(WKPreferencesGetShouldAllowDesignSystemUIFonts):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _shouldAllowDesignSystemUIFonts]):
(-[WKPreferences _setShouldAllowDesignSystemUIFonts:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Source/WTF:

* wtf/Platform.h:

LayoutTests:

* TestExpectations:
* fast/text/design-system-ui-10-expected-mismatch.html: Added.
* fast/text/design-system-ui-10.html: Added.
* fast/text/design-system-ui-11-expected-mismatch.html: Added.
* fast/text/design-system-ui-11.html: Added.
* fast/text/design-system-ui-12-expected-mismatch.html: Added.
* fast/text/design-system-ui-12.html: Added.
* fast/text/design-system-ui-13-expected-mismatch.html: Added.
* fast/text/design-system-ui-13.html: Added.
* fast/text/design-system-ui-14-expected-mismatch.html: Added.
* fast/text/design-system-ui-14.html: Added.
* fast/text/design-system-ui-15-expected-mismatch.html: Added.
* fast/text/design-system-ui-15.html: Added.
* fast/text/design-system-ui-16-expected-mismatch.html: Added.
* fast/text/design-system-ui-16.html: Added.
* fast/text/design-system-ui-2-expected.html: Added.
* fast/text/design-system-ui-2.html: Added.
* fast/text/design-system-ui-3-expected-mismatch.html: Added.
* fast/text/design-system-ui-3.html: Added.
* fast/text/design-system-ui-4-expected-mismatch.html: Added.
* fast/text/design-system-ui-4.html: Added.
* fast/text/design-system-ui-5-expected-mismatch.html: Added.
* fast/text/design-system-ui-5.html: Added.
* fast/text/design-system-ui-6-expected.html: Added.
* fast/text/design-system-ui-6.html: Added.
* fast/text/design-system-ui-7-expected.html: Added.
* fast/text/design-system-ui-7.html: Added.
* fast/text/design-system-ui-8-expected-mismatch.html: Added.
* fast/text/design-system-ui-8.html: Added.
* fast/text/design-system-ui-9-expected-mismatch.html: Added.
* fast/text/design-system-ui-9.html: Added.
* fast/text/design-system-ui-expected.html: Added.
* fast/text/design-system-ui.html: Added.
* platform/mac/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (247376 => 247377)


--- trunk/LayoutTests/ChangeLog	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/LayoutTests/ChangeLog	2019-07-12 01:08:29 UTC (rev 247377)
@@ -1,3 +1,46 @@
+2019-07-11  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        New York font erroneously gets synthetic bold
+        https://bugs.webkit.org/show_bug.cgi?id=199653
+        <rdar://problem/51692592>
+
+        Reviewed by Simon Fraser.
+
+        * TestExpectations:
+        * fast/text/design-system-ui-10-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-10.html: Added.
+        * fast/text/design-system-ui-11-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-11.html: Added.
+        * fast/text/design-system-ui-12-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-12.html: Added.
+        * fast/text/design-system-ui-13-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-13.html: Added.
+        * fast/text/design-system-ui-14-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-14.html: Added.
+        * fast/text/design-system-ui-15-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-15.html: Added.
+        * fast/text/design-system-ui-16-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-16.html: Added.
+        * fast/text/design-system-ui-2-expected.html: Added.
+        * fast/text/design-system-ui-2.html: Added.
+        * fast/text/design-system-ui-3-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-3.html: Added.
+        * fast/text/design-system-ui-4-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-4.html: Added.
+        * fast/text/design-system-ui-5-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-5.html: Added.
+        * fast/text/design-system-ui-6-expected.html: Added.
+        * fast/text/design-system-ui-6.html: Added.
+        * fast/text/design-system-ui-7-expected.html: Added.
+        * fast/text/design-system-ui-7.html: Added.
+        * fast/text/design-system-ui-8-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-8.html: Added.
+        * fast/text/design-system-ui-9-expected-mismatch.html: Added.
+        * fast/text/design-system-ui-9.html: Added.
+        * fast/text/design-system-ui-expected.html: Added.
+        * fast/text/design-system-ui.html: Added.
+        * platform/mac/TestExpectations:
+
 2019-07-11  Carlos Alberto Lopez Perez  <clo...@igalia.com>
 
         [GTK][WPE] Rebaseline css3/blending tests with an empty homedir.

Modified: trunk/LayoutTests/TestExpectations (247376 => 247377)


--- trunk/LayoutTests/TestExpectations	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/LayoutTests/TestExpectations	2019-07-12 01:08:29 UTC (rev 247377)
@@ -3443,3 +3443,11 @@
 webkit.org/b/199028 webgpu/whlsl-test-harness-test.html [ Slow ]
 
 imported/w3c/web-platform-tests/css/cssom-view/offsetTopLeft-inline.html [ ImageOnlyFailure ]
+
+# These tests only work on systems with the design system ui fonts installed.
+fast/text/design-system-ui-11.html [ ImageOnlyFailure ]
+fast/text/design-system-ui-12.html [ ImageOnlyFailure ]
+fast/text/design-system-ui-13.html [ ImageOnlyFailure ]
+fast/text/design-system-ui-14.html [ ImageOnlyFailure ]
+fast/text/design-system-ui-15.html [ ImageOnlyFailure ]
+fast/text/design-system-ui-16.html [ ImageOnlyFailure ]

Added: trunk/LayoutTests/fast/text/design-system-ui-10-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-10-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-10-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+<style>
+@font-face {
+    font-family: "AppleSystemUIRounded";
+    src: local("-apple-system-ui-rounded");
+}
+</style>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px 'AppleSystemUIRounded'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-10.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-10.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-10.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+<style>
+@font-face {
+    font-family: "AppleSystemUIRounded";
+    src: local("-apple-system-ui-rounded");
+}
+</style>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: bold 72px 'AppleSystemUIRounded'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-11-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-11-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-11-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-11.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-11.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-11.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px '-apple-system-ui-serif';">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-12-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-12-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-12-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-12.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-12.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-12.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px '-apple-system-ui-monospaced';">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-13-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-13-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-13-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-13.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-13.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-13.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px '-apple-system-ui-rounded';">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-14-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-14-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-14-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-14.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-14.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-14.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+<style>
+@font-face {
+    font-family: "AppleSystemUISerif";
+    src: local("-apple-system-ui-serif");
+}
+</style>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px 'AppleSystemUISerif';">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-15-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-15-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-15-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-15.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-15.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-15.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+<style>
+@font-face {
+    font-family: "AppleSystemUIMonospaced";
+    src: local("-apple-system-ui-monospaced");
+}
+</style>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px 'AppleSystemUIMonospaced';">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-16-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-16-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-16-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-16.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-16.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-16.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+<style>
+@font-face {
+    font-family: "AppleSystemUIRounded";
+    src: local("-apple-system-ui-rounded");
+}
+</style>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px 'AppleSystemUIRounded';">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-2-expected.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-2-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-2-expected.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+</head>
+<body>
+This test makes sure that the design system UI fonts don't work unless the shouldAllowDesignSystemUIFonts preference is set. The test passes if all the text below is bold.
+<div>
+<div style="display: inline-block; font: bold 72px '-apple-system-ui-serif';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '-apple-system-ui-monospaced';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '-apple-system-ui-rounded';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '.AppleSystemUIFontSerif';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '.SF NS Mono';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '.SF UI Mono';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '.AppleSystemUIFontRounded';">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-2.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-2.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-2.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+</head>
+<body>
+This test makes sure that the design system UI fonts don't work unless the shouldAllowDesignSystemUIFonts preference is set. The test passes if all the text below is bold.
+<div>
+<div style="display: inline-block; font: bold 72px '-apple-system-ui-serif'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '-apple-system-ui-monospaced'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '-apple-system-ui-rounded'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '.AppleSystemUIFontSerif'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '.SF NS Mono'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '.SF UI Mono'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px '.AppleSystemUIFontRounded'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-3-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-3-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-3-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px '-apple-system-ui-serif'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-3.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-3.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-3.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: bold 72px '-apple-system-ui-serif'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-4-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-4-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-4-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px '-apple-system-ui-monospaced'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-4.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-4.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-4.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: bold 72px '-apple-system-ui-monospaced'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-5-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-5-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-5-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px '-apple-system-ui-rounded'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-5.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-5.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-5.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: bold 72px '-apple-system-ui-rounded'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-6-expected.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-6-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-6-expected.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that the design system UI fonts don't work unless the shouldAllowDesignSystemUIFonts preference is set. The test passes if all the text below is rendered in Times.
+<div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-6.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-6.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-6.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: "AppleSystemUISerif";
+    src: local("-apple-system-ui-serif");
+}
+@font-face {
+    font-family: "AppleSystemUIMonospaced";
+    src: local("-apple-system-ui-monospaced");
+}
+@font-face {
+    font-family: "AppleSystemUIRounded";
+    src: local("-apple-system-ui-rounded");
+}
+@font-face {
+    font-family: "DotAppleSystemUIFontSerif";
+    src: local(".AppleSystemUIFontSerif");
+}
+@font-face {
+    font-family: "DotSFNSMono";
+    src: local(".SF NS Mono");
+}
+@font-face {
+    font-family: "DotSFUIMono";
+    src: local(".SF UI Mono");
+}
+@font-face {
+    font-family: "DotAppleSystemUIFontRounded";
+    src: local(".AppleSystemUIFontRounded");
+}
+</style>
+</head>
+<body>
+This test makes sure that the design system UI fonts don't work unless the shouldAllowDesignSystemUIFonts preference is set. The test passes if all the text below is rendered in Times.
+<div>
+<div style="display: inline-block; font: 72px 'AppleSystemUISerif';">HeJllo</div>
+<div style="display: inline-block; font: 72px 'AppleSystemUIMonospaced';">HeJllo</div>
+<div style="display: inline-block; font: 72px 'AppleSystemUIRounded';">HeJllo</div>
+<div style="display: inline-block; font: 72px 'DotAppleSystemUIFontSerif';">HeJllo</div>
+<div style="display: inline-block; font: 72px 'DotSFNSMono';">HeJllo</div>
+<div style="display: inline-block; font: 72px 'DotSFUIMono';">HeJllo</div>
+<div style="display: inline-block; font: 72px 'DotAppleSystemUIFontRounded';">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-7-expected.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-7-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-7-expected.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+<style>
+@font-face {
+    font-family: "AppleSystemUISerif";
+    src: local("-apple-system-ui-serif");
+}
+@font-face {
+    font-family: "AppleSystemUIMonospaced";
+    src: local("-apple-system-ui-monospaced");
+}
+@font-face {
+    font-family: "AppleSystemUIRounded";
+    src: local("-apple-system-ui-rounded");
+}
+@font-face {
+    font-family: "DotAppleSystemUIFontSerif";
+    src: local(".AppleSystemUIFontSerif");
+}
+@font-face {
+    font-family: "DotSFNSMono";
+    src: local(".SF NS Mono");
+}
+@font-face {
+    font-family: "DotSFUIMono";
+    src: local(".SF UI Mono");
+}
+@font-face {
+    font-family: "DotAppleSystemUIFontRounded";
+    src: local(".AppleSystemUIFontRounded");
+}
+</style>
+</head>
+<body>
+This test makes sure that the design system UI fonts don't work unless the shouldAllowDesignSystemUIFonts preference is set. The test passes if all the text below is bold.
+<div>
+<div style="display: inline-block; font: bold 72px 'AppleSystemUISerif';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'AppleSystemUIMonospaced';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'AppleSystemUIRounded';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'DotAppleSystemUIFontSerif';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'DotSFNSMono';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'DotSFUIMono';">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'DotAppleSystemUIFontRounded';">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-7.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-7.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-7.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+<style>
+@font-face {
+    font-family: "AppleSystemUISerif";
+    src: local("-apple-system-ui-serif");
+}
+@font-face {
+    font-family: "AppleSystemUIMonospaced";
+    src: local("-apple-system-ui-monospaced");
+}
+@font-face {
+    font-family: "AppleSystemUIRounded";
+    src: local("-apple-system-ui-rounded");
+}
+@font-face {
+    font-family: "DotAppleSystemUIFontSerif";
+    src: local(".AppleSystemUIFontSerif");
+}
+@font-face {
+    font-family: "DotSFNSMono";
+    src: local(".SF NS Mono");
+}
+@font-face {
+    font-family: "DotSFUIMono";
+    src: local(".SF UI Mono");
+}
+@font-face {
+    font-family: "DotAppleSystemUIFontRounded";
+    src: local(".AppleSystemUIFontRounded");
+}
+</style>
+</head>
+<body>
+This test makes sure that the design system UI fonts don't work unless the shouldAllowDesignSystemUIFonts preference is set. The test passes if all the text below is bold.
+<div>
+<div style="display: inline-block; font: bold 72px 'AppleSystemUISerif'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'AppleSystemUIMonospaced'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'AppleSystemUIRounded'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'DotAppleSystemUIFontSerif'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'DotSFNSMono'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'DotSFUIMono'; font-synthesis: none;">HeJllo</div>
+<div style="display: inline-block; font: bold 72px 'DotAppleSystemUIFontRounded'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-8-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-8-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-8-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+<style>
+@font-face {
+    font-family: "AppleSystemUISerif";
+    src: local("-apple-system-ui-serif");
+}
+</style>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px 'AppleSystemUISerif'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-8.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-8.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-8.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+<style>
+@font-face {
+    font-family: "AppleSystemUISerif";
+    src: local("-apple-system-ui-serif");
+}
+</style>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: bold 72px 'AppleSystemUISerif'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-9-expected-mismatch.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-9-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-9-expected-mismatch.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+<style>
+@font-face {
+    font-family: "AppleSystemUIMonospaced";
+    src: local("-apple-system-ui-monospaced");
+}
+</style>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: 72px 'AppleSystemUIMonospaced'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-9.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-9.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-9.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.internals)
+    window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
+</script>
+<style>
+@font-face {
+    font-family: "AppleSystemUIMonospaced";
+    src: local("-apple-system-ui-monospaced");
+}
+</style>
+</head>
+<body>
+<div>
+<div style="display: inline-block; font: bold 72px 'AppleSystemUIMonospaced'; font-synthesis: none;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui-expected.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui-expected.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that the design system UI fonts don't work unless the shouldAllowDesignSystemUIFonts preference is set. The test passes if all the text below is rendered in Times.
+<div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+<div style="display: inline-block; font-size: 72px;">HeJllo</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/design-system-ui.html (0 => 247377)


--- trunk/LayoutTests/fast/text/design-system-ui.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/design-system-ui.html	2019-07-12 01:08:29 UTC (rev 247377)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that the design system UI fonts don't work unless the shouldAllowDesignSystemUIFonts preference is set. The test passes if all the text below is rendered in Times.
+<div>
+<div style="display: inline-block; font: 72px '-apple-system-ui-serif';">HeJllo</div>
+<div style="display: inline-block; font: 72px '-apple-system-ui-monospaced';">HeJllo</div>
+<div style="display: inline-block; font: 72px '-apple-system-ui-rounded';">HeJllo</div>
+<div style="display: inline-block; font: 72px '.AppleSystemUIFontSerif';">HeJllo</div>
+<div style="display: inline-block; font: 72px '.SF NS Mono';">HeJllo</div>
+<div style="display: inline-block; font: 72px '.SF UI Mono';">HeJllo</div>
+<div style="display: inline-block; font: 72px '.AppleSystemUIFontRounded';">HeJllo</div>
+</div>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/mac/TestExpectations (247376 => 247377)


--- trunk/LayoutTests/platform/mac/TestExpectations	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2019-07-12 01:08:29 UTC (rev 247377)
@@ -1972,3 +1972,11 @@
 [ Catalina+ ] http/wpt/resource-timing/rt-initiatorType-script-module.html [ Pass Failure ]
 [ Catalina+ ] http/wpt/resource-timing/rt-initiatorType-element.html [ Pass Failure ]
 [ Catalina+ ] http/wpt/resource-timing/rt-initiatorType-xmlhttprequest.html [ Pass Failure ]
+
+# These tests require the design system ui fonts to be installed.
+[ Catalina+ ] fast/text/design-system-ui-11.html [ Pass ]
+[ Catalina+ ] fast/text/design-system-ui-12.html [ Pass ]
+[ Catalina+ ] fast/text/design-system-ui-13.html [ Pass ]
+[ Catalina+ ] fast/text/design-system-ui-14.html [ Pass ]
+[ Catalina+ ] fast/text/design-system-ui-15.html [ Pass ]
+[ Catalina+ ] fast/text/design-system-ui-16.html [ Pass ]

Modified: trunk/Source/WTF/ChangeLog (247376 => 247377)


--- trunk/Source/WTF/ChangeLog	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WTF/ChangeLog	2019-07-12 01:08:29 UTC (rev 247377)
@@ -1,3 +1,13 @@
+2019-07-11  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        New York font erroneously gets synthetic bold
+        https://bugs.webkit.org/show_bug.cgi?id=199653
+        <rdar://problem/51692592>
+
+        Reviewed by Simon Fraser.
+
+        * wtf/Platform.h:
+
 2019-07-11  Pablo Saavedra  <psaave...@igalia.com>
 
         [WPE][GTK] Build failure with ENABLE_ACCESSIBILITY=OFF

Modified: trunk/Source/WTF/wtf/Platform.h (247376 => 247377)


--- trunk/Source/WTF/wtf/Platform.h	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WTF/wtf/Platform.h	2019-07-12 01:08:29 UTC (rev 247377)
@@ -1594,3 +1594,7 @@
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
 #define HAVE_SUBVIEWS_IVAR_SPI 1
 #endif
+
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000)
+#define HAVE_DESIGN_SYSTEM_UI_FONTS 1
+#endif

Modified: trunk/Source/WebCore/ChangeLog (247376 => 247377)


--- trunk/Source/WebCore/ChangeLog	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/ChangeLog	2019-07-12 01:08:29 UTC (rev 247377)
@@ -1,3 +1,91 @@
+2019-07-11  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        New York font erroneously gets synthetic bold
+        https://bugs.webkit.org/show_bug.cgi?id=199653
+        <rdar://problem/51692592>
+
+        Reviewed by Simon Fraser.
+
+        This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
+        and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
+        to expose these fonts to the web because we don't a standardization story for them
+        yet, but we do want some apps to be able to use them.
+
+        WebKit clients who want to use these fonts can set
+        -[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.
+
+        The patch generalizes our existing system-ui infrastructure to handle these three
+        additional fonts. It also explicitly disables the unsupported dot-prefixed names
+        so they don't leak out into Web content.
+
+        Tests: fast/text/design-system-ui-10.html
+               fast/text/design-system-ui-11.html
+               fast/text/design-system-ui-12.html
+               fast/text/design-system-ui-13.html
+               fast/text/design-system-ui-14.html
+               fast/text/design-system-ui-15.html
+               fast/text/design-system-ui-16.html
+               fast/text/design-system-ui-2.html
+               fast/text/design-system-ui-3.html
+               fast/text/design-system-ui-4.html
+               fast/text/design-system-ui-5.html
+               fast/text/design-system-ui-6.html
+               fast/text/design-system-ui-7.html
+               fast/text/design-system-ui-8.html
+               fast/text/design-system-ui-9.html
+               fast/text/design-system-ui.html
+
+        * css/CSSFontFace.cpp:
+        (WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
+        * css/CSSFontFace.h:
+        * css/CSSFontFaceSource.cpp:
+        (WebCore::CSSFontFaceSource::load):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::initializeFontStyle):
+        * page/Settings.yaml:
+        * platform/graphics/FontDescription.cpp:
+        (WebCore::m_shouldAllowDesignSystemUIFonts):
+        (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
+        * platform/graphics/FontDescription.h:
+        (WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
+        (WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
+        (WebCore::FontDescription::operator== const):
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::platformFontLookupWithFamily):
+        (WebCore::fontWithFamily):
+        * platform/graphics/cocoa/FontCacheCoreText.h:
+        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
+        (WebCore::systemFontUse):
+        (WebCore::systemFontCascadeList):
+        (WebCore::FontCascadeDescription::effectiveFamilyCount const):
+        (WebCore::FontCascadeDescription::effectiveFamilyAt const):
+        (WebCore::isSystemFontString): Deleted.
+        (WebCore::isUIFontTextStyle): Deleted.
+        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+        (WebCore::FontPlatformData::ctFont const):
+        * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
+        (WebCore::SystemFontDatabaseCoreText::createSystemUI):
+        (WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
+        (WebCore::SystemFontDatabaseCoreText::createTextStyle):
+        (WebCore::SystemFontDatabaseCoreText::cascadeList):
+        (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
+        (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
+        * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
+        * platform/graphics/ios/FontCacheIOS.mm:
+        (WebCore::platformFontWithFamilySpecialCase):
+        * platform/graphics/mac/FontCacheMac.mm:
+        (WebCore::platformFontWithFamilySpecialCase):
+        * style/StyleResolveForDocument.cpp:
+        (WebCore::Style::resolveForDocument):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup):
+        (WebCore::InternalSettings::Backup::restoreTo):
+        (WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
+        * testing/InternalSettings.h:
+        * testing/InternalSettings.idl:
+
 2019-07-11  Pablo Saavedra  <psaave...@igalia.com>
 
         [WPE][GTK] Build failure with ENABLE_ACCESSIBILITY=OFF

Modified: trunk/Source/WebCore/PAL/ChangeLog (247376 => 247377)


--- trunk/Source/WebCore/PAL/ChangeLog	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/PAL/ChangeLog	2019-07-12 01:08:29 UTC (rev 247377)
@@ -1,3 +1,13 @@
+2019-07-11  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        New York font erroneously gets synthetic bold
+        https://bugs.webkit.org/show_bug.cgi?id=199653
+        <rdar://problem/51692592>
+
+        Reviewed by Simon Fraser.
+
+        * pal/spi/cocoa/CoreTextSPI.h:
+
 2019-07-11  Jonathan Bedard  <jbed...@apple.com>
 
         [iOS 13] Enable WebKit build

Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h (247376 => 247377)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h	2019-07-12 01:08:29 UTC (rev 247377)
@@ -111,6 +111,11 @@
 extern const CFStringRef kCTFontDescriptorTextStyleAttribute;
 extern const CFStringRef kCTFontUIFontDesignTrait;
 
+extern const CFStringRef kCTFontUIFontDesignDefault;
+extern const CFStringRef kCTFontUIFontDesignSerif;
+extern const CFStringRef kCTFontUIFontDesignMonospaced;
+extern const CFStringRef kCTFontUIFontDesignRounded;
+
 extern const CFStringRef kCTFrameMaximumNumberOfLinesAttributeName;
 
 bool CTFontDescriptorIsSystemUIFont(CTFontDescriptorRef);

Modified: trunk/Source/WebCore/css/CSSFontFace.cpp (247376 => 247377)


--- trunk/Source/WebCore/css/CSSFontFace.cpp	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/css/CSSFontFace.cpp	2019-07-12 01:08:29 UTC (rev 247377)
@@ -594,6 +594,13 @@
     return AllowUserInstalledFonts::Yes;
 }
 
+bool CSSFontFace::shouldAllowDesignSystemUIFonts() const
+{
+    if (m_fontSelector && m_fontSelector->document())
+        return m_fontSelector->document()->settings().shouldAllowDesignSystemUIFonts();
+    return false;
+}
+
 static Settings::FontLoadTimingOverride fontLoadTimingOverride(CSSFontSelector* fontSelector)
 {
     auto overrideValue = Settings::FontLoadTimingOverride::None;

Modified: trunk/Source/WebCore/css/CSSFontFace.h (247376 => 247377)


--- trunk/Source/WebCore/css/CSSFontFace.h	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/css/CSSFontFace.h	2019-07-12 01:08:29 UTC (rev 247377)
@@ -162,6 +162,7 @@
     bool purgeable() const;
 
     AllowUserInstalledFonts allowUserInstalledFonts() const;
+    bool shouldAllowDesignSystemUIFonts() const;
 
     void updateStyleIfNeeded();
 

Modified: trunk/Source/WebCore/css/CSSFontFaceSource.cpp (247376 => 247377)


--- trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2019-07-12 01:08:29 UTC (rev 247377)
@@ -183,6 +183,7 @@
             fontDescription.setOneFamily(m_familyNameOrURI);
             fontDescription.setComputedSize(1);
             fontDescription.setShouldAllowUserInstalledFonts(m_face.allowUserInstalledFonts());
+            fontDescription.setShouldAllowDesignSystemUIFonts(m_face.shouldAllowDesignSystemUIFonts());
             success = FontCache::singleton().fontForFamily(fontDescription, m_familyNameOrURI, nullptr, nullptr, FontSelectionSpecifiedCapabilities(), true);
             if (RuntimeEnabledFeatures::sharedFeatures().webAPIStatisticsEnabled()) {
                 if (auto* document = fontSelector->document())

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (247376 => 247377)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2019-07-12 01:08:29 UTC (rev 247377)
@@ -1936,6 +1936,7 @@
     fontDescription.setKeywordSizeFromIdentifier(CSSValueMedium);
     setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueMedium, false, document()));
     fontDescription.setShouldAllowUserInstalledFonts(settings().shouldAllowUserInstalledFonts() ? AllowUserInstalledFonts::Yes : AllowUserInstalledFonts::No);
+    fontDescription.setShouldAllowDesignSystemUIFonts(settings().shouldAllowDesignSystemUIFonts());
     setFontDescription(WTFMove(fontDescription));
 }
 

Modified: trunk/Source/WebCore/page/Settings.yaml (247376 => 247377)


--- trunk/Source/WebCore/page/Settings.yaml	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/page/Settings.yaml	2019-07-12 01:08:29 UTC (rev 247377)
@@ -738,6 +738,10 @@
   initial: true
   onChange: setNeedsRecalcStyleInAllFrames
 
+shouldAllowDesignSystemUIFonts:
+  initial: false
+  onChange: setNeedsRecalcStyleInAllFrames
+
 resizeObserverEnabled:
   initial: false
   conditional: RESIZE_OBSERVER

Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (247376 => 247377)


--- trunk/Source/WebCore/platform/graphics/FontCache.h	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h	2019-07-12 01:08:29 UTC (rev 247377)
@@ -128,7 +128,8 @@
 private:
     static std::array<unsigned, 2> makeFlagsKey(const FontDescription& description)
     {
-        unsigned first = static_cast<unsigned>(description.script()) << 14
+        unsigned first = static_cast<unsigned>(description.script()) << 15
+            | static_cast<unsigned>(description.shouldAllowDesignSystemUIFonts()) << 14
             | static_cast<unsigned>(description.shouldAllowUserInstalledFonts()) << 13
             | static_cast<unsigned>(description.fontStyleAxis() == FontStyleAxis::slnt) << 12
             | static_cast<unsigned>(description.opticalSizing()) << 11

Modified: trunk/Source/WebCore/platform/graphics/FontDescription.cpp (247376 => 247377)


--- trunk/Source/WebCore/platform/graphics/FontDescription.cpp	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.cpp	2019-07-12 01:08:29 UTC (rev 247377)
@@ -62,6 +62,7 @@
     , m_opticalSizing(static_cast<unsigned>(FontOpticalSizing::Enabled))
     , m_fontStyleAxis(FontCascadeDescription::initialFontStyleAxis() == FontStyleAxis::ital)
     , m_shouldAllowUserInstalledFonts(static_cast<unsigned>(AllowUserInstalledFonts::No))
+    , m_shouldAllowDesignSystemUIFonts(false)
 {
 }
 

Modified: trunk/Source/WebCore/platform/graphics/FontDescription.h (247376 => 247377)


--- trunk/Source/WebCore/platform/graphics/FontDescription.h	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.h	2019-07-12 01:08:29 UTC (rev 247377)
@@ -97,6 +97,7 @@
     FontOpticalSizing opticalSizing() const { return static_cast<FontOpticalSizing>(m_opticalSizing); }
     FontStyleAxis fontStyleAxis() const { return m_fontStyleAxis ? FontStyleAxis::ital : FontStyleAxis::slnt; }
     AllowUserInstalledFonts shouldAllowUserInstalledFonts() const { return static_cast<AllowUserInstalledFonts>(m_shouldAllowUserInstalledFonts); }
+    bool shouldAllowDesignSystemUIFonts() const { return m_shouldAllowDesignSystemUIFonts; }
 
     void setComputedSize(float s) { m_computedSize = clampToFloat(s); }
     void setItalic(Optional<FontSelectionValue> italic) { m_fontSelectionRequest.slope = italic; }
@@ -132,6 +133,7 @@
     void setOpticalSizing(FontOpticalSizing sizing) { m_opticalSizing = static_cast<unsigned>(sizing); }
     void setFontStyleAxis(FontStyleAxis axis) { m_fontStyleAxis = axis == FontStyleAxis::ital; }
     void setShouldAllowUserInstalledFonts(AllowUserInstalledFonts shouldAllowUserInstalledFonts) { m_shouldAllowUserInstalledFonts = static_cast<unsigned>(shouldAllowUserInstalledFonts); }
+    void setShouldAllowDesignSystemUIFonts(bool allow) { m_shouldAllowDesignSystemUIFonts = allow; }
 
     static AtomString platformResolveGenericFamily(UScriptCode, const AtomString& locale, const AtomString& familyName);
 
@@ -168,6 +170,7 @@
     unsigned m_opticalSizing : 1; // FontOpticalSizing
     unsigned m_fontStyleAxis : 1; // Whether "font-style: italic" or "font-style: oblique 20deg" was specified
     unsigned m_shouldAllowUserInstalledFonts : 1; // AllowUserInstalledFonts: If this description is allowed to match a user-installed font
+    unsigned m_shouldAllowDesignSystemUIFonts : 1; // Whether -apple-system-ui-serif, -apple-system-ui-monospaced, and -apple-system-ui-rounded are supported
 };
 
 inline bool FontDescription::operator==(const FontDescription& other) const
@@ -202,7 +205,8 @@
         && m_variantEastAsianRuby == other.m_variantEastAsianRuby
         && m_opticalSizing == other.m_opticalSizing
         && m_fontStyleAxis == other.m_fontStyleAxis
-        && m_shouldAllowUserInstalledFonts == other.m_shouldAllowUserInstalledFonts;
+        && m_shouldAllowUserInstalledFonts == other.m_shouldAllowUserInstalledFonts
+        && m_shouldAllowDesignSystemUIFonts == other.m_shouldAllowDesignSystemUIFonts;
 }
 
 }

Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (247376 => 247377)


--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2019-07-12 01:08:29 UTC (rev 247377)
@@ -1181,6 +1181,15 @@
     if (!isSystemFont(family) && whitelist.size() && !whitelist.contains(family))
         return { nullptr };
 
+    if (equalLettersIgnoringASCIICase(family, ".applesystemuifontserif")
+        || equalLettersIgnoringASCIICase(family, ".sf ns mono")
+        || equalLettersIgnoringASCIICase(family, ".sf ui mono")
+        || equalLettersIgnoringASCIICase(family, ".applesystemuifontrounded")) {
+        // If you want to use these fonts, set the shouldAllowDesignSystemUIFonts Setting and use
+        // -apple-system-ui-serif, -apple-system-ui-monospaced, and -apple-system-ui-rounded.
+        return { nullptr };
+    }
+
     auto& fontDatabase = allowUserInstalledFonts == AllowUserInstalledFonts::Yes ? FontDatabase::singletonAllowingUserInstalledFonts() : FontDatabase::singletonDisallowingUserInstalledFonts();
     const auto& familyFonts = fontDatabase.collectionForFamily(family.string());
     if (familyFonts.isEmpty()) {
@@ -1238,16 +1247,42 @@
     FontCache::singleton().invalidate();
 }
 
+static RetainPtr<CTFontRef> fontWithFamilySpecialCase(const AtomString& family, const FontDescription& fontDescription, float size, AllowUserInstalledFonts allowUserInstalledFonts)
+{
+#if HAVE(DESIGN_SYSTEM_UI_FONTS)
+    if (!fontDescription.shouldAllowDesignSystemUIFonts())
+        return nullptr;
+
+    Optional<SystemFontDatabaseCoreText::ClientUse> designSystemUI;
+    if (equalLettersIgnoringASCIICase(family, "-apple-system-ui-serif"))
+        designSystemUI = SystemFontDatabaseCoreText::ClientUse::ForSystemUISerif;
+    else if (equalLettersIgnoringASCIICase(family, "-apple-system-ui-monospaced"))
+        designSystemUI = SystemFontDatabaseCoreText::ClientUse::ForSystemUIMonospaced;
+    else if (equalLettersIgnoringASCIICase(family, "-apple-system-ui-rounded"))
+        designSystemUI = SystemFontDatabaseCoreText::ClientUse::ForSystemUIRounded;
+
+    if (designSystemUI) {
+        auto cascadeList = SystemFontDatabaseCoreText::singleton().cascadeList(fontDescription, family, *designSystemUI, allowUserInstalledFonts);
+        if (!cascadeList.isEmpty())
+            return createFontForInstalledFonts(cascadeList[0].get(), size, allowUserInstalledFonts);
+    }
+#endif
+
+    return nullptr;
+}
+
 static RetainPtr<CTFontRef> fontWithFamily(const AtomString& family, const FontDescription& fontDescription, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, float size)
 {
     if (family.isEmpty())
         return nullptr;
 
-    const auto& request = fontDescription.fontSelectionRequest();
     FontLookup fontLookup;
-    fontLookup.result = platformFontWithFamilySpecialCase(family, request, size, fontDescription.shouldAllowUserInstalledFonts());
-    if (!fontLookup.result)
-        fontLookup = platformFontLookupWithFamily(family, request, size, fontDescription.shouldAllowUserInstalledFonts());
+    fontLookup.result = platformFontWithFamilySpecialCase(family, fontDescription, size, fontDescription.shouldAllowUserInstalledFonts());
+    if (!fontLookup.result) {
+        fontLookup.result = fontWithFamilySpecialCase(family, fontDescription, size, fontDescription.shouldAllowUserInstalledFonts());
+        if (!fontLookup.result)
+            fontLookup = platformFontLookupWithFamily(family, fontDescription.fontSelectionRequest(), size, fontDescription.shouldAllowUserInstalledFonts());
+    }
     return preparePlatformFont(fontLookup.result.get(), fontDescription, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities, !fontLookup.createdFromPostScriptName);
 }
 

Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h (247376 => 247377)


--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h	2019-07-12 01:08:29 UTC (rev 247377)
@@ -52,7 +52,7 @@
 
 RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, const FontDescription&, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool applyWeightWidthSlopeVariations = true);
 SynthesisPair computeNecessarySynthesis(CTFontRef, const FontDescription&, bool isPlatformFont = false);
-RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomString& family, FontSelectionRequest, float size, AllowUserInstalledFonts);
+RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomString& family, const FontDescription&, float size, AllowUserInstalledFonts);
 RetainPtr<CTFontRef> platformFontWithFamily(const AtomString& family, FontSelectionRequest, TextRenderingMode, float size);
 bool requiresCustomFallbackFont(UChar32 character);
 FontSelectionCapabilities capabilitiesForFontDescriptor(CTFontDescriptorRef);

Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp (247376 => 247377)


--- trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp	2019-07-12 01:08:29 UTC (rev 247377)
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#include "FontDescription.h"
+#include "FontCascadeDescription.h"
 
 #include "SystemFontDatabaseCoreText.h"
 #include <mutex>
@@ -34,14 +34,6 @@
 
 #if USE_PLATFORM_SYSTEM_FALLBACK_LIST
 
-static inline bool isSystemFontString(const AtomString& string)
-{
-    return equalLettersIgnoringASCIICase(string, "-webkit-system-font")
-        || equalLettersIgnoringASCIICase(string, "-apple-system")
-        || equalLettersIgnoringASCIICase(string, "-apple-system-font")
-        || equalLettersIgnoringASCIICase(string, "system-ui");
-}
-
 #if PLATFORM(IOS_FAMILY)
 
 template<typename T, typename U, std::size_t size, std::size_t... indices> std::array<T, size> convertArray(U (&array)[size], std::index_sequence<indices...>)
@@ -53,9 +45,30 @@
 {
     return convertArray<T>(array, std::make_index_sequence<size> { });
 }
+#endif
 
-static inline bool isUIFontTextStyle(const AtomString& string)
+static inline Optional<SystemFontDatabaseCoreText::ClientUse> matchSystemFontUse(const AtomString& string, bool shouldAllowDesignSystemUIFonts)
 {
+    if (equalLettersIgnoringASCIICase(string, "-webkit-system-font")
+        || equalLettersIgnoringASCIICase(string, "-apple-system")
+        || equalLettersIgnoringASCIICase(string, "-apple-system-font")
+        || equalLettersIgnoringASCIICase(string, "system-ui"))
+        return SystemFontDatabaseCoreText::ClientUse::ForSystemUI;
+
+#if HAVE(DESIGN_SYSTEM_UI_FONTS)
+    if (shouldAllowDesignSystemUIFonts) {
+        if (equalLettersIgnoringASCIICase(string, "-apple-system-ui-serif"))
+            return SystemFontDatabaseCoreText::ClientUse::ForSystemUISerif;
+        if (equalLettersIgnoringASCIICase(string, "-apple-system-ui-monospaced"))
+            return SystemFontDatabaseCoreText::ClientUse::ForSystemUIMonospaced;
+        if (equalLettersIgnoringASCIICase(string, "-apple-system-ui-rounded"))
+            return SystemFontDatabaseCoreText::ClientUse::ForSystemUIRounded;
+    }
+#else
+    UNUSED_PARAM(shouldAllowDesignSystemUIFonts);
+#endif
+
+#if PLATFORM(IOS_FAMILY)
     static const CFStringRef styles[] = {
         kCTUIFontTextStyleHeadline,
         kCTUIFontTextStyleBody,
@@ -79,11 +92,14 @@
     };
     
     static auto strings { makeNeverDestroyed(convertArray<AtomString>(styles)) };
-    return std::find(strings.get().begin(), strings.get().end(), string) != strings.get().end();
-}
+    if (std::find(strings.get().begin(), strings.get().end(), string) != strings.get().end())
+        return SystemFontDatabaseCoreText::ClientUse::ForTextStyle;
 #endif
 
-static inline Vector<RetainPtr<CTFontDescriptorRef>> systemFontCascadeList(const FontCascadeDescription& description, const AtomString& cssFamily, SystemFontDatabaseCoreText::ClientUse clientUse, AllowUserInstalledFonts allowUserInstalledFonts)
+    return WTF::nullopt;
+}
+
+static inline Vector<RetainPtr<CTFontDescriptorRef>> systemFontCascadeList(const FontDescription& description, const AtomString& cssFamily, SystemFontDatabaseCoreText::ClientUse clientUse, AllowUserInstalledFonts allowUserInstalledFonts)
 {
     return SystemFontDatabaseCoreText::singleton().cascadeList(description, cssFamily, clientUse, allowUserInstalledFonts);
 }
@@ -94,12 +110,8 @@
     unsigned result = 0;
     for (unsigned i = 0; i < familyCount(); ++i) {
         const auto& cssFamily = familyAt(i);
-        if (isSystemFontString(cssFamily))
-            result += systemFontCascadeList(*this, cssFamily, SystemFontDatabaseCoreText::ClientUse::ForSystemUI, shouldAllowUserInstalledFonts()).size();
-#if PLATFORM(IOS_FAMILY)
-        else if (isUIFontTextStyle(cssFamily))
-            result += systemFontCascadeList(*this, cssFamily, SystemFontDatabaseCoreText::ClientUse::ForTextStyle, shouldAllowUserInstalledFonts()).size();
-#endif
+        if (auto use = matchSystemFontUse(cssFamily, shouldAllowDesignSystemUIFonts()))
+            result += systemFontCascadeList(*this, cssFamily, *use, shouldAllowUserInstalledFonts()).size();
         else
             ++result;
     }
@@ -117,20 +129,12 @@
     // These two behaviors should be unified, which would hopefully allow us to delete this duplicate code.
     for (unsigned i = 0; i < familyCount(); ++i) {
         const auto& cssFamily = familyAt(i);
-        if (isSystemFontString(cssFamily)) {
-            auto cascadeList = systemFontCascadeList(*this, cssFamily, SystemFontDatabaseCoreText::ClientUse::ForSystemUI, shouldAllowUserInstalledFonts());
+        if (auto use = matchSystemFontUse(cssFamily, shouldAllowDesignSystemUIFonts())) {
+            auto cascadeList = systemFontCascadeList(*this, cssFamily, *use, shouldAllowUserInstalledFonts());
             if (index < cascadeList.size())
                 return FontFamilySpecification(cascadeList[index].get());
             index -= cascadeList.size();
         }
-#if PLATFORM(IOS_FAMILY)
-        else if (isUIFontTextStyle(cssFamily)) {
-            auto cascadeList = systemFontCascadeList(*this, cssFamily, SystemFontDatabaseCoreText::ClientUse::ForTextStyle, shouldAllowUserInstalledFonts());
-            if (index < cascadeList.size())
-                return FontFamilySpecification(cascadeList[index].get());
-            index -= cascadeList.size();
-        }
-#endif
         else if (!index)
             return cssFamily;
         else

Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm (247376 => 247377)


--- trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm	2019-07-12 01:08:29 UTC (rev 247377)
@@ -155,7 +155,7 @@
         return m_ctFont.get();
 
     ASSERT(m_font);
-    m_ctFont = adoptCF(CTFontCreateCopyWithAttributes(m_font.get(), m_size, 0, cascadeToLastResortAndVariationsFontDescriptor(m_font.get()).get()));
+    m_ctFont = adoptCF(CTFontCreateCopyWithAttributes(m_font.get(), m_size, nullptr, cascadeToLastResortAndVariationsFontDescriptor(m_font.get()).get()));
 
     if (m_widthVariant != FontWidthVariant::RegularWidth) {
         int featureTypeValue = kTextSpacingType;

Modified: trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp (247376 => 247377)


--- trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp	2019-07-12 01:08:29 UTC (rev 247377)
@@ -47,6 +47,50 @@
 
 #if USE_PLATFORM_SYSTEM_FALLBACK_LIST
 
+RetainPtr<CTFontRef> SystemFontDatabaseCoreText::createSystemUIFont(const CascadeListParameters& parameters, CFStringRef locale)
+{
+    auto result = adoptCF(CTFontCreateUIFontForLanguage(kCTFontUIFontSystem, parameters.size, locale));
+    ASSERT(result);
+    return createFontByApplyingWeightItalicsAndFallbackBehavior(result.get(), parameters.weight, parameters.italic, parameters.size, parameters.allowUserInstalledFonts);
+}
+
+#if HAVE(DESIGN_SYSTEM_UI_FONTS)
+RetainPtr<CTFontRef> SystemFontDatabaseCoreText::createDesignSystemUIFont(ClientUse clientUse, const CascadeListParameters& parameters)
+{
+    CFStringRef design = kCTFontUIFontDesignDefault;
+    switch (clientUse) {
+    case ClientUse::ForSystemUISerif:
+        design = kCTFontUIFontDesignSerif;
+        break;
+    case ClientUse::ForSystemUIMonospaced:
+        design = kCTFontUIFontDesignMonospaced;
+        break;
+    case ClientUse::ForSystemUIRounded:
+        design = kCTFontUIFontDesignRounded;
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+    return createFontByApplyingWeightItalicsAndFallbackBehavior(nullptr, parameters.weight, parameters.italic, parameters.size, parameters.allowUserInstalledFonts, design);
+}
+#endif
+
+RetainPtr<CTFontRef> SystemFontDatabaseCoreText::createTextStyleFont(const CascadeListParameters& parameters)
+{
+#if PLATFORM(IOS_FAMILY)
+    auto fontDescriptor = adoptCF(CTFontDescriptorCreateWithTextStyle(parameters.fontName.string().createCFString().get(), RenderThemeIOS::contentSizeCategory(), nullptr));
+    // FIXME: Use createFontByApplyingWeightItalicsAndFallbackBehavior() once <rdar://problem/33046041> is fixed.
+    CTFontSymbolicTraits traits = (parameters.weight >= kCTFontWeightSemibold ? kCTFontTraitBold : 0) | (parameters.italic ? kCTFontTraitItalic : 0);
+    if (traits)
+        fontDescriptor = adoptCF(CTFontDescriptorCreateCopyWithSymbolicTraits(fontDescriptor.get(), traits, traits));
+    return createFontForInstalledFonts(fontDescriptor.get(), parameters.size, parameters.allowUserInstalledFonts);
+#else
+    UNUSED_PARAM(parameters);
+    ASSERT_NOT_REACHED();
+    return nullptr;
+#endif
+}
+
 Vector<RetainPtr<CTFontDescriptorRef>> SystemFontDatabaseCoreText::cascadeList(const CascadeListParameters& parameters, ClientUse clientUse)
 {
     ASSERT(!parameters.fontName.isNull());
@@ -53,22 +97,20 @@
     return m_systemFontCache.ensure(parameters, [&] {
         auto localeString = parameters.locale.string().createCFString();
         RetainPtr<CTFontRef> systemFont;
-        if (clientUse == ClientUse::ForSystemUI) {
-            systemFont = adoptCF(CTFontCreateUIFontForLanguage(kCTFontUIFontSystem, parameters.size, localeString.get()));
-            ASSERT(systemFont);
-            // FIXME: Use applyWeightItalicsAndFallbackBehavior() in both cases once <rdar://problem/33046041> is fixed.
-            systemFont = applyWeightItalicsAndFallbackBehavior(systemFont.get(), parameters.weight, parameters.italic, parameters.size, parameters.allowUserInstalledFonts);
-        } else {
-#if PLATFORM(IOS_FAMILY)
-            ASSERT(clientUse == ClientUse::ForTextStyle);
-            auto fontDescriptor = adoptCF(CTFontDescriptorCreateWithTextStyle(parameters.fontName.string().createCFString().get(), RenderThemeIOS::contentSizeCategory(), nullptr));
-            CTFontSymbolicTraits traits = (parameters.weight >= kCTFontWeightSemibold ? kCTFontTraitBold : 0) | (parameters.italic ? kCTFontTraitItalic : 0);
-            if (traits)
-                fontDescriptor = adoptCF(CTFontDescriptorCreateCopyWithSymbolicTraits(fontDescriptor.get(), traits, traits));
-            systemFont = createFontForInstalledFonts(fontDescriptor.get(), parameters.size, parameters.allowUserInstalledFonts);
-#else
-            ASSERT_NOT_REACHED();
+        switch (clientUse) {
+        case ClientUse::ForSystemUI:
+            systemFont = createSystemUIFont(parameters, localeString.get());
+            break;
+        case ClientUse::ForSystemUISerif:
+        case ClientUse::ForSystemUIMonospaced:
+        case ClientUse::ForSystemUIRounded:
+#if HAVE(DESIGN_SYSTEM_UI_FONTS)
+            systemFont = createDesignSystemUIFont(clientUse, parameters);
 #endif
+            break;
+        case ClientUse::ForTextStyle:
+            systemFont = createTextStyleFont(parameters);
+            break;
         }
         ASSERT(systemFont);
         auto result = computeCascadeList(systemFont.get(), localeString.get());
@@ -87,7 +129,7 @@
     m_monospaceFamilies.clear();
 }
 
-RetainPtr<CTFontRef> SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior(CTFontRef font, CGFloat weight, bool italic, float size, AllowUserInstalledFonts allowUserInstalledFonts)
+RetainPtr<CTFontRef> SystemFontDatabaseCoreText::createFontByApplyingWeightItalicsAndFallbackBehavior(CTFontRef font, CGFloat weight, bool italic, float size, AllowUserInstalledFonts allowUserInstalledFonts, CFStringRef design)
 {
     auto weightNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberCGFloatType, &weight));
     const float systemFontItalicSlope = 0.07;
@@ -94,13 +136,15 @@
     float italicsRawNumber = italic ? systemFontItalicSlope : 0;
     auto italicsNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberFloatType, &italicsRawNumber));
     CFTypeRef traitsKeys[] = { kCTFontWeightTrait, kCTFontSlantTrait, kCTFontUIFontDesignTrait };
-    CFTypeRef traitsValues[] = { weightNumber.get(), italicsNumber.get(), kCFBooleanTrue };
+    CFTypeRef traitsValues[] = { weightNumber.get(), italicsNumber.get(), design ? static_cast<CFTypeRef>(design) : static_cast<CFTypeRef>(kCTFontUIFontDesignDefault) };
     auto traitsDictionary = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, traitsKeys, traitsValues, WTF_ARRAY_LENGTH(traitsKeys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     auto attributes = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     CFDictionaryAddValue(attributes.get(), kCTFontTraitsAttribute, traitsDictionary.get());
     addAttributesForInstalledFonts(attributes.get(), allowUserInstalledFonts);
     auto modification = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get()));
-    return adoptCF(CTFontCreateCopyWithAttributes(font, size, nullptr, modification.get()));
+    if (font)
+        return adoptCF(CTFontCreateCopyWithAttributes(font, size, nullptr, modification.get()));
+    return adoptCF(CTFontCreateWithFontDescriptor(modification.get(), size, nullptr));
 }
 
 RetainPtr<CTFontDescriptorRef> SystemFontDatabaseCoreText::removeCascadeList(CTFontDescriptorRef fontDescriptor)
@@ -129,12 +173,13 @@
     return result;
 }
 
-SystemFontDatabaseCoreText::CascadeListParameters SystemFontDatabaseCoreText::systemFontParameters(const FontCascadeDescription& description, const AtomString& familyName, ClientUse clientUse, AllowUserInstalledFonts allowUserInstalledFonts)
+SystemFontDatabaseCoreText::CascadeListParameters SystemFontDatabaseCoreText::systemFontParameters(const FontDescription& description, const AtomString& familyName, ClientUse clientUse, AllowUserInstalledFonts allowUserInstalledFonts)
 {
     CascadeListParameters result;
     result.locale = description.locale();
     result.size = description.computedSize();
     result.italic = isItalic(description.italic());
+    result.allowUserInstalledFonts = allowUserInstalledFonts;
 
     auto weight = description.weight();
     if (FontCache::singleton().shouldMockBoldSystemFontForAccessibility())
@@ -159,20 +204,36 @@
     else
         result.weight = kCTFontWeightBlack;
 
-    if (clientUse == ClientUse::ForSystemUI) {
+    switch (clientUse) {
+    case ClientUse::ForSystemUI: {
         static NeverDestroyed<AtomString> systemUI = AtomString("system-ui", AtomString::ConstructFromLiteral);
         result.fontName = systemUI.get();
-    } else {
-        ASSERT(clientUse == ClientUse::ForTextStyle);
+        break;
+    }
+    case ClientUse::ForSystemUISerif: {
+        static NeverDestroyed<AtomString> systemUISerif = AtomString("system-ui-serif", AtomString::ConstructFromLiteral);
+        result.fontName = systemUISerif.get();
+        break;
+    }
+    case ClientUse::ForSystemUIMonospaced: {
+        static NeverDestroyed<AtomString> systemUIMonospaced = AtomString("system-ui-monospaced", AtomString::ConstructFromLiteral);
+        result.fontName = systemUIMonospaced.get();
+        break;
+    }
+    case ClientUse::ForSystemUIRounded: {
+        static NeverDestroyed<AtomString> systemUIRounded = AtomString("system-ui-rounded", AtomString::ConstructFromLiteral);
+        result.fontName = systemUIRounded.get();
+        break;
+    }
+    case ClientUse::ForTextStyle:
         result.fontName = familyName;
+        break;
     }
 
-    result.allowUserInstalledFonts = allowUserInstalledFonts;
-
     return result;
 }
 
-Vector<RetainPtr<CTFontDescriptorRef>> SystemFontDatabaseCoreText::cascadeList(const FontCascadeDescription& description, const AtomString& cssFamily, ClientUse clientUse, AllowUserInstalledFonts allowUserInstalledFonts)
+Vector<RetainPtr<CTFontDescriptorRef>> SystemFontDatabaseCoreText::cascadeList(const FontDescription& description, const AtomString& cssFamily, ClientUse clientUse, AllowUserInstalledFonts allowUserInstalledFonts)
 {
     return cascadeList(systemFontParameters(description, cssFamily, clientUse, allowUserInstalledFonts), clientUse);
 }

Modified: trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.h (247376 => 247377)


--- trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.h	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.h	2019-07-12 01:08:29 UTC (rev 247377)
@@ -25,7 +25,7 @@
 
 #pragma once
 
-#include "FontCascadeDescription.h"
+#include "FontDescription.h"
 #include <pal/spi/cocoa/CoreTextSPI.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashTraits.h>
@@ -96,9 +96,15 @@
 
     static SystemFontDatabaseCoreText& singleton();
 
-    enum class ClientUse { ForSystemUI, ForTextStyle };
+    enum class ClientUse : uint8_t {
+        ForSystemUI,
+        ForSystemUISerif,
+        ForSystemUIMonospaced,
+        ForSystemUIRounded,
+        ForTextStyle
+    };
 
-    Vector<RetainPtr<CTFontDescriptorRef>> cascadeList(const FontCascadeDescription&, const AtomString& cssFamily, ClientUse, AllowUserInstalledFonts);
+    Vector<RetainPtr<CTFontDescriptorRef>> cascadeList(const FontDescription&, const AtomString& cssFamily, ClientUse, AllowUserInstalledFonts);
 
     String serifFamily(const String& locale);
     String sansSerifFamily(const String& locale);
@@ -113,10 +119,14 @@
 
     Vector<RetainPtr<CTFontDescriptorRef>> cascadeList(const CascadeListParameters&, ClientUse);
 
-    static RetainPtr<CTFontRef> applyWeightItalicsAndFallbackBehavior(CTFontRef, CGFloat weight, bool italic, float size, AllowUserInstalledFonts);
+    RetainPtr<CTFontRef> createSystemUIFont(const CascadeListParameters&, CFStringRef locale);
+    RetainPtr<CTFontRef> createDesignSystemUIFont(ClientUse, const CascadeListParameters&);
+    RetainPtr<CTFontRef> createTextStyleFont(const CascadeListParameters&);
+
+    static RetainPtr<CTFontRef> createFontByApplyingWeightItalicsAndFallbackBehavior(CTFontRef, CGFloat weight, bool italic, float size, AllowUserInstalledFonts, CFStringRef design = nullptr);
     static RetainPtr<CTFontDescriptorRef> removeCascadeList(CTFontDescriptorRef);
     static Vector<RetainPtr<CTFontDescriptorRef>> computeCascadeList(CTFontRef, CFStringRef locale);
-    static CascadeListParameters systemFontParameters(const FontCascadeDescription&, const AtomString& familyName, ClientUse, AllowUserInstalledFonts);
+    static CascadeListParameters systemFontParameters(const FontDescription&, const AtomString& familyName, ClientUse, AllowUserInstalledFonts);
 
     HashMap<CascadeListParameters, Vector<RetainPtr<CTFontDescriptorRef>>, CascadeListParameters::CascadeListParametersHash, SimpleClassHashTraits<CascadeListParameters>> m_systemFontCache;
 

Modified: trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (247376 => 247377)


--- trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2019-07-12 01:08:29 UTC (rev 247377)
@@ -33,6 +33,7 @@
 
 #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>
@@ -128,9 +129,11 @@
     return adoptCF(CTFontDescriptorCreateCopyWithAttributes(fontDescriptor.get(), static_cast<CFDictionaryRef>(attributes.get())));
 }
 
-RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomString& family, FontSelectionRequest request, float size, AllowUserInstalledFonts allowUserInstalledFonts)
+RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomString& family, const FontDescription& fontDescription, float size, AllowUserInstalledFonts allowUserInstalledFonts)
 {
     // FIXME: See comment in FontCascadeDescription::effectiveFamilyAt() in FontDescriptionCocoa.cpp
+    const auto& request = fontDescription.fontSelectionRequest();
+
     if (family.startsWith("UICTFontTextStyle")) {
         CTFontSymbolicTraits traits = (isFontWeightBold(request.weight) || FontCache::singleton().shouldMockBoldSystemFontForAccessibility() ? kCTFontTraitBold : 0) | (isItalic(request.slope) ? kCTFontTraitItalic : 0);
         RetainPtr<CFStringRef> familyNameStr = family.string().createCFString();
@@ -140,6 +143,7 @@
         return createFontForInstalledFonts(fontDescriptor.get(), size, allowUserInstalledFonts);
     }
 
+    // FIXME: Migrate this to use SystemFontDatabaseCoreText like the design system-ui block below.
     if (equalLettersIgnoringASCIICase(family, "-webkit-system-font") || equalLettersIgnoringASCIICase(family, "-apple-system") || equalLettersIgnoringASCIICase(family, "-apple-system-font") || equalLettersIgnoringASCIICase(family, "system-ui")) {
         auto fontDescriptor = systemFontDescriptor(request.weight, isFontWeightBold(request.weight), isItalic(request.slope), size);
         return createFontForInstalledFonts(fontDescriptor.get(), size, allowUserInstalledFonts);

Modified: trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (247376 => 247377)


--- trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm	2019-07-12 01:08:29 UTC (rev 247377)
@@ -33,6 +33,7 @@
 #import "Font.h"
 #import "FontCascade.h"
 #import "FontPlatformData.h"
+#import "SystemFontDatabaseCoreText.h"
 #import <pal/spi/cg/CoreGraphicsSPI.h>
 #import <pal/spi/cocoa/CoreTextSPI.h>
 
@@ -73,9 +74,12 @@
     return NSFontWeightBlack;
 }
 
-RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomString& family, FontSelectionRequest request, float size, AllowUserInstalledFonts allowUserInstalledFonts)
+RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomString& family, const FontDescription& fontDescription, float size, AllowUserInstalledFonts allowUserInstalledFonts)
 {
     // FIXME: See comment in FontCascadeDescription::effectiveFamilyAt() in FontDescriptionCocoa.cpp
+    const auto& request = fontDescription.fontSelectionRequest();
+
+    // FIXME: Migrate this to use SystemFontDatabaseCoreText like the design system-ui block below.
     if (equalLettersIgnoringASCIICase(family, "-webkit-system-font") || equalLettersIgnoringASCIICase(family, "-apple-system") || equalLettersIgnoringASCIICase(family, "-apple-system-font") || equalLettersIgnoringASCIICase(family, "system-ui")) {
         RetainPtr<CTFontRef> result = toCTFont([NSFont systemFontOfSize:size weight:toNSFontWeight(request.weight)]);
         if (isItalic(request.slope)) {

Modified: trunk/Source/WebCore/style/StyleResolveForDocument.cpp (247376 => 247377)


--- trunk/Source/WebCore/style/StyleResolveForDocument.cpp	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/style/StyleResolveForDocument.cpp	2019-07-12 01:08:29 UTC (rev 247377)
@@ -110,6 +110,7 @@
     fontDescription.setRenderingMode(settings.fontRenderingMode());
     fontDescription.setOneFamily(standardFamily);
     fontDescription.setShouldAllowUserInstalledFonts(settings.shouldAllowUserInstalledFonts() ? AllowUserInstalledFonts::Yes : AllowUserInstalledFonts::No);
+    fontDescription.setShouldAllowDesignSystemUIFonts(settings.shouldAllowDesignSystemUIFonts());
 
     fontDescription.setKeywordSizeFromIdentifier(CSSValueMedium);
     int size = fontSizeForKeyword(CSSValueMedium, false, document);

Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (247376 => 247377)


--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp	2019-07-12 01:08:29 UTC (rev 247377)
@@ -471,6 +471,7 @@
         m_page->settings().setPluginsEnabled(false);
         m_page->settings().setAcceleratedCompositingEnabled(false);
         m_page->settings().setShouldAllowUserInstalledFonts(false);
+        m_page->settings().setShouldAllowDesignSystemUIFonts(false);
 
         Frame& frame = m_page->mainFrame();
         frame.setView(FrameView::create(frame));

Modified: trunk/Source/WebKit/ChangeLog (247376 => 247377)


--- trunk/Source/WebKit/ChangeLog	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebKit/ChangeLog	2019-07-12 01:08:29 UTC (rev 247377)
@@ -1,3 +1,23 @@
+2019-07-11  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        New York font erroneously gets synthetic bold
+        https://bugs.webkit.org/show_bug.cgi?id=199653
+        <rdar://problem/51692592>
+
+        Reviewed by Simon Fraser.
+
+        Add the SPI to enable the new fonts.
+
+        * Shared/WebPreferences.yaml:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetShouldAllowDesignSystemUIFonts):
+        (WKPreferencesGetShouldAllowDesignSystemUIFonts):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _shouldAllowDesignSystemUIFonts]):
+        (-[WKPreferences _setShouldAllowDesignSystemUIFonts:]):
+        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
+
 2019-07-11  Chris Dumez  <cdu...@apple.com>
 
         ASSERTION FAILED: RunLoop::isMain() under IPC::Connection::sendWithAsyncReply()

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (247376 => 247377)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2019-07-12 01:08:29 UTC (rev 247377)
@@ -1126,6 +1126,10 @@
   type: bool
   defaultValue: true
 
+ShouldAllowDesignSystemUIFonts:
+  type: bool
+  defaultValue: false
+
 MediaCapabilitiesEnabled:
   type: bool
   defaultValue: true

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm (247376 => 247377)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2019-07-12 01:08:29 UTC (rev 247377)
@@ -713,6 +713,16 @@
     _preferences->setShouldAllowUserInstalledFonts(_shouldAllowUserInstalledFonts);
 }
 
+- (BOOL)_shouldAllowDesignSystemUIFonts
+{
+    return _preferences->shouldAllowDesignSystemUIFonts();
+}
+
+- (void)_setShouldAllowDesignSystemUIFonts:(BOOL)_shouldAllowDesignSystemUIFonts
+{
+    _preferences->setShouldAllowDesignSystemUIFonts(_shouldAllowDesignSystemUIFonts);
+}
+
 static _WKEditableLinkBehavior toAPI(WebCore::EditableLinkBehavior behavior)
 {
     switch (behavior) {

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h (247376 => 247377)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2019-07-12 00:49:53 UTC (rev 247376)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h	2019-07-12 01:08:29 UTC (rev 247377)
@@ -126,6 +126,7 @@
 @property (nonatomic, setter=_setDOMPasteAllowed:) BOOL _domPasteAllowed WK_API_AVAILABLE(macos(10.13), ios(11.0));
 
 @property (nonatomic, setter=_setShouldAllowUserInstalledFonts:) BOOL _shouldAllowUserInstalledFonts WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
+@property (nonatomic, setter=_setShouldAllowDesignSystemUIFonts:) BOOL _shouldAllowDesignSystemUIFonts WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 @property (nonatomic, setter=_setEditableLinkBehavior:) _WKEditableLinkBehavior _editableLinkBehavior WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to