Changeset 251413 in webkit


Ignore:
Timestamp:
Oct 21, 2019 9:05:19 PM (5 years ago)
Author:
mmaxfield@apple.com
Message:

[Cocoa] Move ui-serif, ui-monospaced, and ui-rounded out from behind SPI
https://bugs.webkit.org/show_bug.cgi?id=203129

Reviewed by Tim Horton.

Source/WebCore:

https://github.com/w3c/csswg-drafts/issues/4107 resolved to name these new fonts
ui-serif, ui-monospaced, and ui-rounded. This patch renames them, and removes the SPI
to access these fonts.

Tests: fast/text/design-system-ui*.html

  • css/CSSFontFace.cpp:

(WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const): Deleted.

  • css/CSSFontFace.h:
  • css/CSSFontFaceSource.cpp:

(WebCore::CSSFontFaceSource::load):

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::initializeFontStyle):

  • page/Settings.yaml:
  • platform/graphics/FontCache.h:

(WebCore::FontDescriptionKey::makeFlagsKey):

  • platform/graphics/FontDescription.cpp:

(WebCore::m_shouldAllowUserInstalledFonts):
(WebCore::m_shouldAllowDesignSystemUIFonts): Deleted.

  • platform/graphics/FontDescription.h:

(WebCore::FontDescription::shouldAllowUserInstalledFonts const):
(WebCore::FontDescription::setShouldAllowUserInstalledFonts):
(WebCore::FontDescription::operator== const):
(WebCore::FontDescription::shouldAllowDesignSystemUIFonts const): Deleted.
(WebCore::FontDescription::setShouldAllowDesignSystemUIFonts): Deleted.

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::platformFontLookupWithFamily):
(WebCore::fontWithFamilySpecialCase):

  • platform/graphics/cocoa/FontDescriptionCocoa.cpp:

(WebCore::matchSystemFontUse):
(WebCore::FontCascadeDescription::effectiveFamilyCount const):
(WebCore::FontCascadeDescription::effectiveFamilyAt const):

  • platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:

(WebCore::SystemFontDatabaseCoreText::systemFontParameters):

  • style/StyleResolveForDocument.cpp:

(WebCore::Style::resolveForDocument):

  • svg/graphics/SVGImage.cpp:

(WebCore::SVGImage::dataChanged):

Source/WebKit:

  • Shared/WebPreferences.yaml:
  • UIProcess/API/Cocoa/WKPreferences.mm:

(-[WKPreferences _shouldAllowDesignSystemUIFonts]): Deleted.
(-[WKPreferences _setShouldAllowDesignSystemUIFonts:]): Deleted.

  • UIProcess/API/Cocoa/WKPreferencesPrivate.h:

LayoutTests:

Update the tests to use the new names, and to not set the setting.

  • fast/text/design-system-ui-10-expected-mismatch.html:
  • 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-expected.html:
  • fast/text/design-system-ui-2.html:
  • fast/text/design-system-ui-3-expected-mismatch.html:
  • fast/text/design-system-ui-3.html:
  • fast/text/design-system-ui-4-expected-mismatch.html:
  • fast/text/design-system-ui-4.html:
  • fast/text/design-system-ui-5-expected-mismatch.html:
  • fast/text/design-system-ui-5.html:
  • fast/text/design-system-ui-6-expected.html:
  • fast/text/design-system-ui-6.html:
  • fast/text/design-system-ui-7-expected.html:
  • fast/text/design-system-ui-7.html:
  • fast/text/design-system-ui-8-expected-mismatch.html:
  • fast/text/design-system-ui-8.html:
  • fast/text/design-system-ui-9-expected-mismatch.html:
  • fast/text/design-system-ui-9.html:
  • fast/text/design-system-ui-expected.html:
  • fast/text/design-system-ui.html:
Location:
trunk
Files:
45 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r251412 r251413  
     12019-10-21  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Cocoa] Move ui-serif, ui-monospaced, and ui-rounded out from behind SPI
     4        https://bugs.webkit.org/show_bug.cgi?id=203129
     5
     6        Reviewed by Tim Horton.
     7
     8        Update the tests to use the new names, and to not set the setting.
     9
     10        * fast/text/design-system-ui-10-expected-mismatch.html:
     11        * fast/text/design-system-ui-10.html:
     12        * fast/text/design-system-ui-11.html:
     13        * fast/text/design-system-ui-12.html:
     14        * fast/text/design-system-ui-13.html:
     15        * fast/text/design-system-ui-14.html:
     16        * fast/text/design-system-ui-15.html:
     17        * fast/text/design-system-ui-16.html:
     18        * fast/text/design-system-ui-2-expected.html:
     19        * fast/text/design-system-ui-2.html:
     20        * fast/text/design-system-ui-3-expected-mismatch.html:
     21        * fast/text/design-system-ui-3.html:
     22        * fast/text/design-system-ui-4-expected-mismatch.html:
     23        * fast/text/design-system-ui-4.html:
     24        * fast/text/design-system-ui-5-expected-mismatch.html:
     25        * fast/text/design-system-ui-5.html:
     26        * fast/text/design-system-ui-6-expected.html:
     27        * fast/text/design-system-ui-6.html:
     28        * fast/text/design-system-ui-7-expected.html:
     29        * fast/text/design-system-ui-7.html:
     30        * fast/text/design-system-ui-8-expected-mismatch.html:
     31        * fast/text/design-system-ui-8.html:
     32        * fast/text/design-system-ui-9-expected-mismatch.html:
     33        * fast/text/design-system-ui-9.html:
     34        * fast/text/design-system-ui-expected.html:
     35        * fast/text/design-system-ui.html:
     36
    1372019-10-21  Simon Fraser  <simon.fraser@apple.com>
    238
  • trunk/LayoutTests/fast/text/design-system-ui-10-expected-mismatch.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84<style>
    95@font-face {
    106    font-family: "AppleSystemUIRounded";
    11     src: local("-apple-system-ui-rounded");
     7    src: local("ui-rounded");
    128}
    139</style>
  • trunk/LayoutTests/fast/text/design-system-ui-10.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84<style>
    95@font-face {
    106    font-family: "AppleSystemUIRounded";
    11     src: local("-apple-system-ui-rounded");
     7    src: local("ui-rounded");
    128}
    139</style>
  • trunk/LayoutTests/fast/text/design-system-ui-11.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84</head>
    95<body>
    106<div>
    11 <div style="display: inline-block; font: 72px '-apple-system-ui-serif';">HeJllo</div>
     7<div style="display: inline-block; font: 72px 'ui-serif';">HeJllo</div>
    128</div>
    139</body>
  • trunk/LayoutTests/fast/text/design-system-ui-12.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84</head>
    95<body>
    106<div>
    11 <div style="display: inline-block; font: 72px '-apple-system-ui-monospaced';">HeJllo</div>
     7<div style="display: inline-block; font: 72px 'ui-monospaced';">HeJllo</div>
    128</div>
    139</body>
  • trunk/LayoutTests/fast/text/design-system-ui-13.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84</head>
    95<body>
    106<div>
    11 <div style="display: inline-block; font: 72px '-apple-system-ui-rounded';">HeJllo</div>
     7<div style="display: inline-block; font: 72px 'ui-rounded';">HeJllo</div>
    128</div>
    139</body>
  • trunk/LayoutTests/fast/text/design-system-ui-14.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84<style>
    95@font-face {
    106    font-family: "AppleSystemUISerif";
    11     src: local("-apple-system-ui-serif");
     7    src: local("ui-serif");
    128}
    139</style>
  • trunk/LayoutTests/fast/text/design-system-ui-15.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84<style>
    95@font-face {
    106    font-family: "AppleSystemUIMonospaced";
    11     src: local("-apple-system-ui-monospaced");
     7    src: local("ui-monospaced");
    128}
    139</style>
  • trunk/LayoutTests/fast/text/design-system-ui-16.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84<style>
    95@font-face {
    106    font-family: "AppleSystemUIRounded";
    11     src: local("-apple-system-ui-rounded");
     7    src: local("ui-rounded");
    128}
    139</style>
  • trunk/LayoutTests/fast/text/design-system-ui-2-expected.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84</head>
    95<body>
    10 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.
     6This test makes sure that the bold versions of the design system UI fonts work. The test passes if all the text below is bold.
    117<div>
    12 <div style="display: inline-block; font: bold 72px '-apple-system-ui-serif';">HeJllo</div>
    13 <div style="display: inline-block; font: bold 72px '-apple-system-ui-monospaced';">HeJllo</div>
    14 <div style="display: inline-block; font: bold 72px '-apple-system-ui-rounded';">HeJllo</div>
     8<div style="display: inline-block; font: bold 72px 'ui-serif';">HeJllo</div>
     9<div style="display: inline-block; font: bold 72px 'ui-monospaced';">HeJllo</div>
     10<div style="display: inline-block; font: bold 72px 'ui-rounded';">HeJllo</div>
    1511<div style="display: inline-block; font: bold 72px '.AppleSystemUIFontSerif';">HeJllo</div>
    1612<div style="display: inline-block; font: bold 72px '.SF NS Mono';">HeJllo</div>
  • trunk/LayoutTests/fast/text/design-system-ui-2.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84</head>
    95<body>
    10 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.
     6This test makes sure that the bold versions of the design system UI fonts work. The test passes if all the text below is bold.
    117<div>
    12 <div style="display: inline-block; font: bold 72px '-apple-system-ui-serif'; font-synthesis: none;">HeJllo</div>
    13 <div style="display: inline-block; font: bold 72px '-apple-system-ui-monospaced'; font-synthesis: none;">HeJllo</div>
    14 <div style="display: inline-block; font: bold 72px '-apple-system-ui-rounded'; font-synthesis: none;">HeJllo</div>
     8<div style="display: inline-block; font: bold 72px 'ui-serif'; font-synthesis: none;">HeJllo</div>
     9<div style="display: inline-block; font: bold 72px 'ui-monospaced'; font-synthesis: none;">HeJllo</div>
     10<div style="display: inline-block; font: bold 72px 'ui-rounded'; font-synthesis: none;">HeJllo</div>
    1511<div style="display: inline-block; font: bold 72px '.AppleSystemUIFontSerif'; font-synthesis: none;">HeJllo</div>
    1612<div style="display: inline-block; font: bold 72px '.SF NS Mono'; font-synthesis: none;">HeJllo</div>
  • trunk/LayoutTests/fast/text/design-system-ui-3-expected-mismatch.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84</head>
    95<body>
    106<div>
    11 <div style="display: inline-block; font: 72px '-apple-system-ui-serif'; font-synthesis: none;">HeJllo</div>
     7<div style="display: inline-block; font: 72px 'ui-serif'; font-synthesis: none;">HeJllo</div>
    128</div>
    139</body>
  • trunk/LayoutTests/fast/text/design-system-ui-3.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84</head>
    95<body>
    106<div>
    11 <div style="display: inline-block; font: bold 72px '-apple-system-ui-serif'; font-synthesis: none;">HeJllo</div>
     7<div style="display: inline-block; font: bold 72px 'ui-serif'; font-synthesis: none;">HeJllo</div>
    128</div>
    139</body>
  • trunk/LayoutTests/fast/text/design-system-ui-4-expected-mismatch.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84</head>
    95<body>
    106<div>
    11 <div style="display: inline-block; font: 72px '-apple-system-ui-monospaced'; font-synthesis: none;">HeJllo</div>
     7<div style="display: inline-block; font: 72px 'ui-monospaced'; font-synthesis: none;">HeJllo</div>
    128</div>
    139</body>
  • trunk/LayoutTests/fast/text/design-system-ui-4.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84</head>
    95<body>
    106<div>
    11 <div style="display: inline-block; font: bold 72px '-apple-system-ui-monospaced'; font-synthesis: none;">HeJllo</div>
     7<div style="display: inline-block; font: bold 72px 'ui-monospaced'; font-synthesis: none;">HeJllo</div>
    128</div>
    139</body>
  • trunk/LayoutTests/fast/text/design-system-ui-5-expected-mismatch.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84</head>
    95<body>
    106<div>
    11 <div style="display: inline-block; font: 72px '-apple-system-ui-rounded'; font-synthesis: none;">HeJllo</div>
     7<div style="display: inline-block; font: 72px 'ui-rounded'; font-synthesis: none;">HeJllo</div>
    128</div>
    139</body>
  • trunk/LayoutTests/fast/text/design-system-ui-5.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84</head>
    95<body>
    106<div>
    11 <div style="display: inline-block; font: bold 72px '-apple-system-ui-rounded'; font-synthesis: none;">HeJllo</div>
     7<div style="display: inline-block; font: bold 72px 'ui-rounded'; font-synthesis: none;">HeJllo</div>
    128</div>
    139</body>
  • trunk/LayoutTests/fast/text/design-system-ui-6-expected.html

    r247377 r251413  
    44</head>
    55<body>
    6 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.
     6This test makes sure that the design system UI fonts don't work unless they are accessed from their correct names. The test passes if all the text below is rendered in Times.
    77<div>
    8 <div style="display: inline-block; font-size: 72px;">HeJllo</div>
    9 <div style="display: inline-block; font-size: 72px;">HeJllo</div>
    10 <div style="display: inline-block; font-size: 72px;">HeJllo</div>
    118<div style="display: inline-block; font-size: 72px;">HeJllo</div>
    129<div style="display: inline-block; font-size: 72px;">HeJllo</div>
  • trunk/LayoutTests/fast/text/design-system-ui-6.html

    r247377 r251413  
    33<head>
    44<style>
    5 @font-face {
    6     font-family: "AppleSystemUISerif";
    7     src: local("-apple-system-ui-serif");
    8 }
    9 @font-face {
    10     font-family: "AppleSystemUIMonospaced";
    11     src: local("-apple-system-ui-monospaced");
    12 }
    13 @font-face {
    14     font-family: "AppleSystemUIRounded";
    15     src: local("-apple-system-ui-rounded");
    16 }
    175@font-face {
    186    font-family: "DotAppleSystemUIFontSerif";
     
    3422</head>
    3523<body>
    36 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.
     24This test makes sure that the design system UI fonts don't work unless they are accessed from their correct names. The test passes if all the text below is rendered in Times.
    3725<div>
    38 <div style="display: inline-block; font: 72px 'AppleSystemUISerif';">HeJllo</div>
    39 <div style="display: inline-block; font: 72px 'AppleSystemUIMonospaced';">HeJllo</div>
    40 <div style="display: inline-block; font: 72px 'AppleSystemUIRounded';">HeJllo</div>
    4126<div style="display: inline-block; font: 72px 'DotAppleSystemUIFontSerif';">HeJllo</div>
    4227<div style="display: inline-block; font: 72px 'DotSFNSMono';">HeJllo</div>
  • trunk/LayoutTests/fast/text/design-system-ui-7-expected.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84<style>
    95@font-face {
    106    font-family: "AppleSystemUISerif";
    11     src: local("-apple-system-ui-serif");
     7    src: local("ui-serif");
    128}
    139@font-face {
    1410    font-family: "AppleSystemUIMonospaced";
    15     src: local("-apple-system-ui-monospaced");
     11    src: local("ui-monospaced");
    1612}
    1713@font-face {
    1814    font-family: "AppleSystemUIRounded";
    19     src: local("-apple-system-ui-rounded");
     15    src: local("ui-rounded");
    2016}
    2117@font-face {
     
    3834</head>
    3935<body>
    40 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.
     36This test makes sure that the bold versions of the design system UI fonts work in @font-face. The test passes if all the text below is bold.
    4137<div>
    4238<div style="display: inline-block; font: bold 72px 'AppleSystemUISerif';">HeJllo</div>
  • trunk/LayoutTests/fast/text/design-system-ui-7.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84<style>
    95@font-face {
    106    font-family: "AppleSystemUISerif";
    11     src: local("-apple-system-ui-serif");
     7    src: local("ui-serif");
    128}
    139@font-face {
    1410    font-family: "AppleSystemUIMonospaced";
    15     src: local("-apple-system-ui-monospaced");
     11    src: local("ui-monospaced");
    1612}
    1713@font-face {
    1814    font-family: "AppleSystemUIRounded";
    19     src: local("-apple-system-ui-rounded");
     15    src: local("ui-rounded");
    2016}
    2117@font-face {
     
    3834</head>
    3935<body>
    40 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.
     36This test makes sure that the bold versions of the design system UI fonts work in @font-face. The test passes if all the text below is bold.
    4137<div>
    4238<div style="display: inline-block; font: bold 72px 'AppleSystemUISerif'; font-synthesis: none;">HeJllo</div>
  • trunk/LayoutTests/fast/text/design-system-ui-8-expected-mismatch.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84<style>
    95@font-face {
    106    font-family: "AppleSystemUISerif";
    11     src: local("-apple-system-ui-serif");
     7    src: local("ui-serif");
    128}
    139</style>
  • trunk/LayoutTests/fast/text/design-system-ui-8.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84<style>
    95@font-face {
    106    font-family: "AppleSystemUISerif";
    11     src: local("-apple-system-ui-serif");
     7    src: local("ui-serif");
    128}
    139</style>
  • trunk/LayoutTests/fast/text/design-system-ui-9-expected-mismatch.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84<style>
    95@font-face {
    106    font-family: "AppleSystemUIMonospaced";
    11     src: local("-apple-system-ui-monospaced");
     7    src: local("ui-monospaced");
    128}
    139</style>
  • trunk/LayoutTests/fast/text/design-system-ui-9.html

    r247377 r251413  
    22<html>
    33<head>
    4 <script>
    5 if (window.internals)
    6     window.internals.settings.setShouldAllowDesignSystemUIFonts(true);
    7 </script>
    84<style>
    95@font-face {
    106    font-family: "AppleSystemUIMonospaced";
    11     src: local("-apple-system-ui-monospaced");
     7    src: local("ui-monospaced");
    128}
    139</style>
  • trunk/LayoutTests/fast/text/design-system-ui-expected.html

    r247377 r251413  
    44</head>
    55<body>
    6 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.
     6This test makes sure that the design system UI fonts don't work unless they are accessed from their correct names. The test passes if all the text below is rendered in Times.
    77<div>
    8 <div style="display: inline-block; font-size: 72px;">HeJllo</div>
    9 <div style="display: inline-block; font-size: 72px;">HeJllo</div>
    10 <div style="display: inline-block; font-size: 72px;">HeJllo</div>
    118<div style="display: inline-block; font-size: 72px;">HeJllo</div>
    129<div style="display: inline-block; font-size: 72px;">HeJllo</div>
  • trunk/LayoutTests/fast/text/design-system-ui.html

    r247377 r251413  
    44</head>
    55<body>
    6 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.
     6This test makes sure that the design system UI fonts don't work unless they are accessed from their correct names. The test passes if all the text below is rendered in Times.
    77<div>
    8 <div style="display: inline-block; font: 72px '-apple-system-ui-serif';">HeJllo</div>
    9 <div style="display: inline-block; font: 72px '-apple-system-ui-monospaced';">HeJllo</div>
    10 <div style="display: inline-block; font: 72px '-apple-system-ui-rounded';">HeJllo</div>
    118<div style="display: inline-block; font: 72px '.AppleSystemUIFontSerif';">HeJllo</div>
    129<div style="display: inline-block; font: 72px '.SF NS Mono';">HeJllo</div>
  • trunk/Source/WebCore/ChangeLog

    r251409 r251413  
     12019-10-21  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Cocoa] Move ui-serif, ui-monospaced, and ui-rounded out from behind SPI
     4        https://bugs.webkit.org/show_bug.cgi?id=203129
     5
     6        Reviewed by Tim Horton.
     7
     8        https://github.com/w3c/csswg-drafts/issues/4107 resolved to name these new fonts
     9        ui-serif, ui-monospaced, and ui-rounded. This patch renames them, and removes the SPI
     10        to access these fonts.
     11
     12        Tests: fast/text/design-system-ui*.html
     13
     14        * css/CSSFontFace.cpp:
     15        (WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const): Deleted.
     16        * css/CSSFontFace.h:
     17        * css/CSSFontFaceSource.cpp:
     18        (WebCore::CSSFontFaceSource::load):
     19        * css/StyleResolver.cpp:
     20        (WebCore::StyleResolver::initializeFontStyle):
     21        * page/Settings.yaml:
     22        * platform/graphics/FontCache.h:
     23        (WebCore::FontDescriptionKey::makeFlagsKey):
     24        * platform/graphics/FontDescription.cpp:
     25        (WebCore::m_shouldAllowUserInstalledFonts):
     26        (WebCore::m_shouldAllowDesignSystemUIFonts): Deleted.
     27        * platform/graphics/FontDescription.h:
     28        (WebCore::FontDescription::shouldAllowUserInstalledFonts const):
     29        (WebCore::FontDescription::setShouldAllowUserInstalledFonts):
     30        (WebCore::FontDescription::operator== const):
     31        (WebCore::FontDescription::shouldAllowDesignSystemUIFonts const): Deleted.
     32        (WebCore::FontDescription::setShouldAllowDesignSystemUIFonts): Deleted.
     33        * platform/graphics/cocoa/FontCacheCoreText.cpp:
     34        (WebCore::platformFontLookupWithFamily):
     35        (WebCore::fontWithFamilySpecialCase):
     36        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
     37        (WebCore::matchSystemFontUse):
     38        (WebCore::FontCascadeDescription::effectiveFamilyCount const):
     39        (WebCore::FontCascadeDescription::effectiveFamilyAt const):
     40        * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
     41        (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
     42        * style/StyleResolveForDocument.cpp:
     43        (WebCore::Style::resolveForDocument):
     44        * svg/graphics/SVGImage.cpp:
     45        (WebCore::SVGImage::dataChanged):
     46
    1472019-10-21  youenn fablet  <youenn@apple.com>
    248
  • trunk/Source/WebCore/css/CSSFontFace.cpp

    r250983 r251413  
    595595}
    596596
    597 bool CSSFontFace::shouldAllowDesignSystemUIFonts() const
    598 {
    599     if (m_fontSelector && m_fontSelector->document())
    600         return m_fontSelector->document()->settings().shouldAllowDesignSystemUIFonts();
    601     return false;
    602 }
    603 
    604597static Settings::FontLoadTimingOverride fontLoadTimingOverride(CSSFontSelector* fontSelector)
    605598{
  • trunk/Source/WebCore/css/CSSFontFace.h

    r250803 r251413  
    164164
    165165    AllowUserInstalledFonts allowUserInstalledFonts() const;
    166     bool shouldAllowDesignSystemUIFonts() const;
    167166
    168167    void updateStyleIfNeeded();
  • trunk/Source/WebCore/css/CSSFontFaceSource.cpp

    r248748 r251413  
    180180            fontDescription.setComputedSize(1);
    181181            fontDescription.setShouldAllowUserInstalledFonts(m_face.allowUserInstalledFonts());
    182             fontDescription.setShouldAllowDesignSystemUIFonts(m_face.shouldAllowDesignSystemUIFonts());
    183182            success = FontCache::singleton().fontForFamily(fontDescription, m_familyNameOrURI, nullptr, nullptr, FontSelectionSpecifiedCapabilities(), true);
    184183            if (RuntimeEnabledFeatures::sharedFeatures().webAPIStatisticsEnabled()) {
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r251289 r251413  
    19521952    setFontSize(fontDescription, Style::fontSizeForKeyword(CSSValueMedium, false, document()));
    19531953    fontDescription.setShouldAllowUserInstalledFonts(settings().shouldAllowUserInstalledFonts() ? AllowUserInstalledFonts::Yes : AllowUserInstalledFonts::No);
    1954     fontDescription.setShouldAllowDesignSystemUIFonts(settings().shouldAllowDesignSystemUIFonts());
    19551954    setFontDescription(WTFMove(fontDescription));
    19561955}
  • trunk/Source/WebCore/page/Settings.yaml

    r251298 r251413  
    752752  onChange: setNeedsRecalcStyleInAllFrames
    753753
    754 shouldAllowDesignSystemUIFonts:
    755   initial: false
    756   onChange: setNeedsRecalcStyleInAllFrames
    757 
    758754resizeObserverEnabled:
    759755  initial: false
  • trunk/Source/WebCore/platform/graphics/FontCache.h

    r247720 r251413  
    129129    static std::array<unsigned, 2> makeFlagsKey(const FontDescription& description)
    130130    {
    131         unsigned first = static_cast<unsigned>(description.script()) << 15
    132             | static_cast<unsigned>(description.shouldAllowDesignSystemUIFonts()) << 14
     131        unsigned first = static_cast<unsigned>(description.script()) << 14
    133132            | static_cast<unsigned>(description.shouldAllowUserInstalledFonts()) << 13
    134133            | static_cast<unsigned>(description.fontStyleAxis() == FontStyleAxis::slnt) << 12
  • trunk/Source/WebCore/platform/graphics/FontDescription.cpp

    r247377 r251413  
    6363    , m_fontStyleAxis(FontCascadeDescription::initialFontStyleAxis() == FontStyleAxis::ital)
    6464    , m_shouldAllowUserInstalledFonts(static_cast<unsigned>(AllowUserInstalledFonts::No))
    65     , m_shouldAllowDesignSystemUIFonts(false)
    6665{
    6766}
  • trunk/Source/WebCore/platform/graphics/FontDescription.h

    r247465 r251413  
    9696    FontStyleAxis fontStyleAxis() const { return m_fontStyleAxis ? FontStyleAxis::ital : FontStyleAxis::slnt; }
    9797    AllowUserInstalledFonts shouldAllowUserInstalledFonts() const { return static_cast<AllowUserInstalledFonts>(m_shouldAllowUserInstalledFonts); }
    98     bool shouldAllowDesignSystemUIFonts() const { return m_shouldAllowDesignSystemUIFonts; }
    9998
    10099    void setComputedSize(float s) { m_computedSize = clampToFloat(s); }
     
    132131    void setFontStyleAxis(FontStyleAxis axis) { m_fontStyleAxis = axis == FontStyleAxis::ital; }
    133132    void setShouldAllowUserInstalledFonts(AllowUserInstalledFonts shouldAllowUserInstalledFonts) { m_shouldAllowUserInstalledFonts = static_cast<unsigned>(shouldAllowUserInstalledFonts); }
    134     void setShouldAllowDesignSystemUIFonts(bool allow) { m_shouldAllowDesignSystemUIFonts = allow; }
    135133
    136134    static AtomString platformResolveGenericFamily(UScriptCode, const AtomString& locale, const AtomString& familyName);
     
    169167    unsigned m_fontStyleAxis : 1; // Whether "font-style: italic" or "font-style: oblique 20deg" was specified
    170168    unsigned m_shouldAllowUserInstalledFonts : 1; // AllowUserInstalledFonts: If this description is allowed to match a user-installed font
    171     unsigned m_shouldAllowDesignSystemUIFonts : 1; // Whether -apple-system-ui-serif, -apple-system-ui-monospaced, and -apple-system-ui-rounded are supported
    172169};
    173170
     
    204201        && m_opticalSizing == other.m_opticalSizing
    205202        && m_fontStyleAxis == other.m_fontStyleAxis
    206         && m_shouldAllowUserInstalledFonts == other.m_shouldAllowUserInstalledFonts
    207         && m_shouldAllowDesignSystemUIFonts == other.m_shouldAllowDesignSystemUIFonts;
     203        && m_shouldAllowUserInstalledFonts == other.m_shouldAllowUserInstalledFonts;
    208204}
    209205
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp

    r250031 r251413  
    12071207        || equalLettersIgnoringASCIICase(family, ".sf ui mono")
    12081208        || equalLettersIgnoringASCIICase(family, ".applesystemuifontrounded")) {
    1209         // If you want to use these fonts, set the shouldAllowDesignSystemUIFonts Setting and use
    1210         // -apple-system-ui-serif, -apple-system-ui-monospaced, and -apple-system-ui-rounded.
     1209        // If you want to use these fonts, use ui-serif, ui-monospaced, and ui-rounded.
    12111210        return { nullptr };
    12121211    }
     
    12721271{
    12731272#if HAVE(DESIGN_SYSTEM_UI_FONTS)
    1274     if (!fontDescription.shouldAllowDesignSystemUIFonts())
    1275         return nullptr;
    1276 
    12771273    Optional<SystemFontDatabaseCoreText::ClientUse> designSystemUI;
    1278     if (equalLettersIgnoringASCIICase(family, "-apple-system-ui-serif"))
     1274    if (equalLettersIgnoringASCIICase(family, "ui-serif"))
    12791275        designSystemUI = SystemFontDatabaseCoreText::ClientUse::ForSystemUISerif;
    1280     else if (equalLettersIgnoringASCIICase(family, "-apple-system-ui-monospaced"))
     1276    else if (equalLettersIgnoringASCIICase(family, "ui-monospaced"))
    12811277        designSystemUI = SystemFontDatabaseCoreText::ClientUse::ForSystemUIMonospaced;
    1282     else if (equalLettersIgnoringASCIICase(family, "-apple-system-ui-rounded"))
     1278    else if (equalLettersIgnoringASCIICase(family, "ui-rounded"))
    12831279        designSystemUI = SystemFontDatabaseCoreText::ClientUse::ForSystemUIRounded;
    12841280
  • trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp

    r247465 r251413  
    4848#endif
    4949
    50 static inline Optional<SystemFontDatabaseCoreText::ClientUse> matchSystemFontUse(const AtomString& string, bool shouldAllowDesignSystemUIFonts)
     50static inline Optional<SystemFontDatabaseCoreText::ClientUse> matchSystemFontUse(const AtomString& string)
    5151{
    5252    if (equalLettersIgnoringASCIICase(string, "-webkit-system-font")
     
    5757
    5858#if HAVE(DESIGN_SYSTEM_UI_FONTS)
    59     if (shouldAllowDesignSystemUIFonts) {
    60         if (equalLettersIgnoringASCIICase(string, "-apple-system-ui-serif"))
    61             return SystemFontDatabaseCoreText::ClientUse::ForSystemUISerif;
    62         if (equalLettersIgnoringASCIICase(string, "-apple-system-ui-monospaced"))
    63             return SystemFontDatabaseCoreText::ClientUse::ForSystemUIMonospaced;
    64         if (equalLettersIgnoringASCIICase(string, "-apple-system-ui-rounded"))
    65             return SystemFontDatabaseCoreText::ClientUse::ForSystemUIRounded;
    66     }
    67 #else
    68     UNUSED_PARAM(shouldAllowDesignSystemUIFonts);
     59    if (equalLettersIgnoringASCIICase(string, "ui-serif"))
     60        return SystemFontDatabaseCoreText::ClientUse::ForSystemUISerif;
     61    if (equalLettersIgnoringASCIICase(string, "ui-monospaced"))
     62        return SystemFontDatabaseCoreText::ClientUse::ForSystemUIMonospaced;
     63    if (equalLettersIgnoringASCIICase(string, "ui-rounded"))
     64        return SystemFontDatabaseCoreText::ClientUse::ForSystemUIRounded;
    6965#endif
    7066
     
    111107    for (unsigned i = 0; i < familyCount(); ++i) {
    112108        const auto& cssFamily = familyAt(i);
    113         if (auto use = matchSystemFontUse(cssFamily, shouldAllowDesignSystemUIFonts()))
     109        if (auto use = matchSystemFontUse(cssFamily))
    114110            result += systemFontCascadeList(*this, cssFamily, *use, shouldAllowUserInstalledFonts()).size();
    115111        else
     
    130126    for (unsigned i = 0; i < familyCount(); ++i) {
    131127        const auto& cssFamily = familyAt(i);
    132         if (auto use = matchSystemFontUse(cssFamily, shouldAllowDesignSystemUIFonts())) {
     128        if (auto use = matchSystemFontUse(cssFamily)) {
    133129            auto cascadeList = systemFontCascadeList(*this, cssFamily, *use, shouldAllowUserInstalledFonts());
    134130            if (index < cascadeList.size())
  • trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp

    r251093 r251413  
    218218    }
    219219    case ClientUse::ForSystemUISerif: {
    220         static NeverDestroyed<AtomString> systemUISerif = AtomString("system-ui-serif", AtomString::ConstructFromLiteral);
     220        static NeverDestroyed<AtomString> systemUISerif = AtomString("ui-serif", AtomString::ConstructFromLiteral);
    221221        result.fontName = systemUISerif.get();
    222222        break;
    223223    }
    224224    case ClientUse::ForSystemUIMonospaced: {
    225         static NeverDestroyed<AtomString> systemUIMonospaced = AtomString("system-ui-monospaced", AtomString::ConstructFromLiteral);
     225        static NeverDestroyed<AtomString> systemUIMonospaced = AtomString("ui-monospaced", AtomString::ConstructFromLiteral);
    226226        result.fontName = systemUIMonospaced.get();
    227227        break;
    228228    }
    229229    case ClientUse::ForSystemUIRounded: {
    230         static NeverDestroyed<AtomString> systemUIRounded = AtomString("system-ui-rounded", AtomString::ConstructFromLiteral);
     230        static NeverDestroyed<AtomString> systemUIRounded = AtomString("ui-rounded", AtomString::ConstructFromLiteral);
    231231        result.fontName = systemUIRounded.get();
    232232        break;
  • trunk/Source/WebCore/style/StyleResolveForDocument.cpp

    r247377 r251413  
    111111    fontDescription.setOneFamily(standardFamily);
    112112    fontDescription.setShouldAllowUserInstalledFonts(settings.shouldAllowUserInstalledFonts() ? AllowUserInstalledFonts::Yes : AllowUserInstalledFonts::No);
    113     fontDescription.setShouldAllowDesignSystemUIFonts(settings.shouldAllowDesignSystemUIFonts());
    114113
    115114    fontDescription.setKeywordSizeFromIdentifier(CSSValueMedium);
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r250006 r251413  
    484484        m_page->settings().setAcceleratedCompositingEnabled(false);
    485485        m_page->settings().setShouldAllowUserInstalledFonts(false);
    486         m_page->settings().setShouldAllowDesignSystemUIFonts(false);
    487486
    488487        Frame& frame = m_page->mainFrame();
  • trunk/Source/WebKit/ChangeLog

    r251409 r251413  
     12019-10-21  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Cocoa] Move ui-serif, ui-monospaced, and ui-rounded out from behind SPI
     4        https://bugs.webkit.org/show_bug.cgi?id=203129
     5
     6        Reviewed by Tim Horton.
     7
     8        * Shared/WebPreferences.yaml:
     9        * UIProcess/API/Cocoa/WKPreferences.mm:
     10        (-[WKPreferences _shouldAllowDesignSystemUIFonts]): Deleted.
     11        (-[WKPreferences _setShouldAllowDesignSystemUIFonts:]): Deleted.
     12        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
     13
    1142019-10-21  youenn fablet  <youenn@apple.com>
    215
  • trunk/Source/WebKit/Shared/WebPreferences.yaml

    r251298 r251413  
    11321132  defaultValue: true
    11331133
    1134 ShouldAllowDesignSystemUIFonts:
    1135   type: bool
    1136   defaultValue: false
    1137 
    11381134MediaCapabilitiesEnabled:
    11391135  type: bool
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm

    r251220 r251413  
    714714}
    715715
    716 - (BOOL)_shouldAllowDesignSystemUIFonts
    717 {
    718     return _preferences->shouldAllowDesignSystemUIFonts();
    719 }
    720 
    721 - (void)_setShouldAllowDesignSystemUIFonts:(BOOL)_shouldAllowDesignSystemUIFonts
    722 {
    723     _preferences->setShouldAllowDesignSystemUIFonts(_shouldAllowDesignSystemUIFonts);
    724 }
    725 
    726716static _WKEditableLinkBehavior toAPI(WebCore::EditableLinkBehavior behavior)
    727717{
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h

    r248957 r251413  
    127127
    128128@property (nonatomic, setter=_setShouldAllowUserInstalledFonts:) BOOL _shouldAllowUserInstalledFonts WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
    129 @property (nonatomic, setter=_setShouldAllowDesignSystemUIFonts:) BOOL _shouldAllowDesignSystemUIFonts WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    130129
    131130@property (nonatomic, setter=_setEditableLinkBehavior:) _WKEditableLinkBehavior _editableLinkBehavior WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
Note: See TracChangeset for help on using the changeset viewer.