Changeset 247462 in webkit


Ignore:
Timestamp:
Jul 15, 2019 5:17:56 PM (5 years ago)
Author:
mmaxfield@apple.com
Message:

Source/WebCore:
Fix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.

Patch by Simon Fraser <Simon Fraser> on 2019-07-11

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::fontWithFamilySpecialCase):

Source/WebKit:
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:

Source/WTF:
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:

LayoutTests:
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:
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r247457 r247462  
     12019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        New York font erroneously gets synthetic bold
     4        https://bugs.webkit.org/show_bug.cgi?id=199653
     5        <rdar://problem/51692592>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * TestExpectations:
     10        * fast/text/design-system-ui-10-expected-mismatch.html: Added.
     11        * fast/text/design-system-ui-10.html: Added.
     12        * fast/text/design-system-ui-11-expected-mismatch.html: Added.
     13        * fast/text/design-system-ui-11.html: Added.
     14        * fast/text/design-system-ui-12-expected-mismatch.html: Added.
     15        * fast/text/design-system-ui-12.html: Added.
     16        * fast/text/design-system-ui-13-expected-mismatch.html: Added.
     17        * fast/text/design-system-ui-13.html: Added.
     18        * fast/text/design-system-ui-14-expected-mismatch.html: Added.
     19        * fast/text/design-system-ui-14.html: Added.
     20        * fast/text/design-system-ui-15-expected-mismatch.html: Added.
     21        * fast/text/design-system-ui-15.html: Added.
     22        * fast/text/design-system-ui-16-expected-mismatch.html: Added.
     23        * fast/text/design-system-ui-16.html: Added.
     24        * fast/text/design-system-ui-2-expected.html: Added.
     25        * fast/text/design-system-ui-2.html: Added.
     26        * fast/text/design-system-ui-3-expected-mismatch.html: Added.
     27        * fast/text/design-system-ui-3.html: Added.
     28        * fast/text/design-system-ui-4-expected-mismatch.html: Added.
     29        * fast/text/design-system-ui-4.html: Added.
     30        * fast/text/design-system-ui-5-expected-mismatch.html: Added.
     31        * fast/text/design-system-ui-5.html: Added.
     32        * fast/text/design-system-ui-6-expected.html: Added.
     33        * fast/text/design-system-ui-6.html: Added.
     34        * fast/text/design-system-ui-7-expected.html: Added.
     35        * fast/text/design-system-ui-7.html: Added.
     36        * fast/text/design-system-ui-8-expected-mismatch.html: Added.
     37        * fast/text/design-system-ui-8.html: Added.
     38        * fast/text/design-system-ui-9-expected-mismatch.html: Added.
     39        * fast/text/design-system-ui-9.html: Added.
     40        * fast/text/design-system-ui-expected.html: Added.
     41        * fast/text/design-system-ui.html: Added.
     42        * platform/mac/TestExpectations:
     43
    1442019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
    245
  • trunk/Source/WTF/ChangeLog

    r247461 r247462  
     12019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        New York font erroneously gets synthetic bold
     4        https://bugs.webkit.org/show_bug.cgi?id=199653
     5        <rdar://problem/51692592>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * wtf/Platform.h:
     10
    1112019-07-15  Brady Eidson  <beidson@apple.com>
    212
  • trunk/Source/WTF/wtf/Platform.h

    r247422 r247462  
    15991599#endif
    16001600
     1601#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 40000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 110000)
     1602#define USE_PLATFORM_SYSTEM_FALLBACK_LIST 1
     1603#endif
     1604
    16011605#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)
    16021606#define HAVE_DESIGN_SYSTEM_UI_FONTS 1
  • trunk/Source/WebCore/ChangeLog

    r247459 r247462  
     12019-07-11  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix builds where HAVE_DESIGN_SYSTEM_UI_FONTS is not defined.
     4
     5        * platform/graphics/cocoa/FontCacheCoreText.cpp:
     6        (WebCore::fontWithFamilySpecialCase):
     7
     82019-07-11  Justin Fan  <justin_fan@apple.com>
     9
     10        Unreviewed build fix.
     11
     12        * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Missing include.
     13
     142019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
     15
     16        New York font erroneously gets synthetic bold
     17        https://bugs.webkit.org/show_bug.cgi?id=199653
     18        <rdar://problem/51692592>
     19
     20        Reviewed by Simon Fraser.
     21
     22        This patch adds support for -apple-system-ui-serif, -apple-system-ui-monospaced,
     23        and -apple-system-ui-rounded, behind an SPI that is off-by-default. We don't want
     24        to expose these fonts to the web because we don't a standardization story for them
     25        yet, but we do want some apps to be able to use them.
     26
     27        WebKit clients who want to use these fonts can set
     28        -[WKPreferences _shouldAllowDesignSystemUIFonts] = YES.
     29
     30        The patch generalizes our existing system-ui infrastructure to handle these three
     31        additional fonts. It also explicitly disables the unsupported dot-prefixed names
     32        so they don't leak out into Web content.
     33
     34        Tests: fast/text/design-system-ui-10.html
     35               fast/text/design-system-ui-11.html
     36               fast/text/design-system-ui-12.html
     37               fast/text/design-system-ui-13.html
     38               fast/text/design-system-ui-14.html
     39               fast/text/design-system-ui-15.html
     40               fast/text/design-system-ui-16.html
     41               fast/text/design-system-ui-2.html
     42               fast/text/design-system-ui-3.html
     43               fast/text/design-system-ui-4.html
     44               fast/text/design-system-ui-5.html
     45               fast/text/design-system-ui-6.html
     46               fast/text/design-system-ui-7.html
     47               fast/text/design-system-ui-8.html
     48               fast/text/design-system-ui-9.html
     49               fast/text/design-system-ui.html
     50
     51        * css/CSSFontFace.cpp:
     52        (WebCore::CSSFontFace::shouldAllowDesignSystemUIFonts const):
     53        * css/CSSFontFace.h:
     54        * css/CSSFontFaceSource.cpp:
     55        (WebCore::CSSFontFaceSource::load):
     56        * css/StyleResolver.cpp:
     57        (WebCore::StyleResolver::initializeFontStyle):
     58        * page/Settings.yaml:
     59        * platform/graphics/FontDescription.cpp:
     60        (WebCore::m_shouldAllowDesignSystemUIFonts):
     61        (WebCore::m_shouldAllowUserInstalledFonts): Deleted.
     62        * platform/graphics/FontDescription.h:
     63        (WebCore::FontDescription::shouldAllowDesignSystemUIFonts const):
     64        (WebCore::FontDescription::setShouldAllowDesignSystemUIFonts):
     65        (WebCore::FontDescription::operator== const):
     66        * platform/graphics/cocoa/FontCacheCoreText.cpp:
     67        (WebCore::platformFontLookupWithFamily):
     68        (WebCore::fontWithFamily):
     69        * platform/graphics/cocoa/FontCacheCoreText.h:
     70        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
     71        (WebCore::systemFontUse):
     72        (WebCore::systemFontCascadeList):
     73        (WebCore::FontCascadeDescription::effectiveFamilyCount const):
     74        (WebCore::FontCascadeDescription::effectiveFamilyAt const):
     75        (WebCore::isSystemFontString): Deleted.
     76        (WebCore::isUIFontTextStyle): Deleted.
     77        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
     78        (WebCore::FontPlatformData::ctFont const):
     79        * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
     80        (WebCore::SystemFontDatabaseCoreText::createSystemUI):
     81        (WebCore::SystemFontDatabaseCoreText::createDesignSystemUI):
     82        (WebCore::SystemFontDatabaseCoreText::createTextStyle):
     83        (WebCore::SystemFontDatabaseCoreText::cascadeList):
     84        (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
     85        (WebCore::SystemFontDatabaseCoreText::systemFontParameters):
     86        * platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
     87        * platform/graphics/ios/FontCacheIOS.mm:
     88        (WebCore::platformFontWithFamilySpecialCase):
     89        * platform/graphics/mac/FontCacheMac.mm:
     90        (WebCore::platformFontWithFamilySpecialCase):
     91        * style/StyleResolveForDocument.cpp:
     92        (WebCore::Style::resolveForDocument):
     93        * svg/graphics/SVGImage.cpp:
     94        (WebCore::SVGImage::dataChanged):
     95        * testing/InternalSettings.cpp:
     96        (WebCore::InternalSettings::Backup::Backup):
     97        (WebCore::InternalSettings::Backup::restoreTo):
     98        (WebCore::InternalSettings::setShouldAllowDesignSystemUIFonts):
     99        * testing/InternalSettings.h:
     100        * testing/InternalSettings.idl:
     101
    11022019-07-15  Chris Dumez  <cdumez@apple.com>
    2103
  • trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp

    r247442 r247462  
    3131#include "WHLSLCallExpression.h"
    3232#include "WHLSLFunctionDefinition.h"
     33#include "WHLSLProgram.h"
    3334#include "WHLSLVisitor.h"
    3435#include <wtf/HashSet.h>
  • trunk/Source/WebCore/page/ProcessWarming.cpp

    r246490 r247462  
    7373    commonVM();
    7474
    75 #if USE_PLATFORM_SYSTEM_FALLBACK_LIST
     75#if USE(PLATFORM_SYSTEM_FALLBACK_LIST)
    7676    // Cache system UI font fallbacks. Almost every web process needs these.
    7777    // Initializing one size is sufficient to warm CoreText caches.
  • trunk/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm

    r246892 r247462  
    4545void platformReleaseMemory(Critical)
    4646{
    47 #if USE_PLATFORM_SYSTEM_FALLBACK_LIST
     47#if USE(PLATFORM_SYSTEM_FALLBACK_LIST)
    4848    SystemFontDatabaseCoreText::singleton().clear();
    4949#endif
  • trunk/Source/WebCore/platform/graphics/FontCascadeDescription.cpp

    r246490 r247462  
    6363}
    6464
    65 #if !USE_PLATFORM_SYSTEM_FALLBACK_LIST
     65#if !USE(PLATFORM_SYSTEM_FALLBACK_LIST)
    6666
    6767unsigned FontCascadeDescription::effectiveFamilyCount() const
  • trunk/Source/WebCore/platform/graphics/FontDescription.h

    r247377 r247462  
    3131#include <unicode/uscript.h>
    3232#include <wtf/MathExtras.h>
    33 
    34 #define USE_PLATFORM_SYSTEM_FALLBACK_LIST ((PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300))
    3533
    3634namespace WebCore {
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp

    r247452 r247462  
    12381238    }
    12391239
    1240 #if USE_PLATFORM_SYSTEM_FALLBACK_LIST
     1240#if USE(PLATFORM_SYSTEM_FALLBACK_LIST)
    12411241    SystemFontDatabaseCoreText::singleton().clear();
    12421242#endif
     
    13941394    CFIndex coveredLength = 0;
    13951395    RetainPtr<CTFontRef> result;
    1396 #if !USE_PLATFORM_SYSTEM_FALLBACK_LIST && (PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && TARGET_OS_IOS))
     1396#if !USE(PLATFORM_SYSTEM_FALLBACK_LIST) && (PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && TARGET_OS_IOS))
    13971397    result = adoptCF(CTFontCreatePhysicalFontForCharactersWithLanguage(font, characters, length, localeString.get(), &coveredLength));
    13981398#else
  • trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp

    r247377 r247462  
    3333namespace WebCore {
    3434
    35 #if USE_PLATFORM_SYSTEM_FALLBACK_LIST
     35#if USE(PLATFORM_SYSTEM_FALLBACK_LIST)
    3636
    3737#if PLATFORM(IOS_FAMILY)
     
    122122{
    123123    // The special cases in this function need to match the behavior in FontCacheIOS.mm and FontCacheMac.mm. On systems
    124     // where USE_PLATFORM_SYSTEM_FALLBACK_LIST is set to true, this code is used for regular (element style) lookups,
     124    // where USE(PLATFORM_SYSTEM_FALLBACK_LIST) is set to true, this code is used for regular (element style) lookups,
    125125    // and the code in FontDescriptionCocoa.cpp is used when src:local(special-cased-name) is specified inside an
    126126    // @font-face block.
     
    145145}
    146146
    147 #endif // USE_PLATFORM_SYSTEM_FALLBACK_LIST
     147#endif // USE(PLATFORM_SYSTEM_FALLBACK_LIST)
    148148
    149149static String computeSpecializedChineseLocale()
  • trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp

    r247102 r247462  
    104104
    105105        auto fontForSynthesisComputation = font;
    106 #if USE_PLATFORM_SYSTEM_FALLBACK_LIST
     106#if USE(PLATFORM_SYSTEM_FALLBACK_LIST)
    107107        if (auto physicalFont = adoptCF(CTFontCopyPhysicalFont(font.get())))
    108108            fontForSynthesisComputation = physicalFont;
  • trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp

    r247377 r247462  
    4646}
    4747
    48 #if USE_PLATFORM_SYSTEM_FALLBACK_LIST
     48#if USE(PLATFORM_SYSTEM_FALLBACK_LIST)
    4949
    5050RetainPtr<CTFontRef> SystemFontDatabaseCoreText::createSystemUIFont(const CascadeListParameters& parameters, CFStringRef locale)
     
    239239}
    240240
    241 #endif // USE_PLATFORM_SYSTEM_FALLBACK_LIST
     241#endif // USE(PLATFORM_SYSTEM_FALLBACK_LIST)
    242242
    243243static String genericFamily(const String& locale, HashMap<String, String>& map, CFStringRef ctKey)
  • trunk/Source/WebKit/ChangeLog

    r247461 r247462  
     12019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        New York font erroneously gets synthetic bold
     4        https://bugs.webkit.org/show_bug.cgi?id=199653
     5        <rdar://problem/51692592>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add the SPI to enable the new fonts.
     10
     11        * Shared/WebPreferences.yaml:
     12        * UIProcess/API/C/WKPreferences.cpp:
     13        (WKPreferencesSetShouldAllowDesignSystemUIFonts):
     14        (WKPreferencesGetShouldAllowDesignSystemUIFonts):
     15        * UIProcess/API/C/WKPreferencesRefPrivate.h:
     16        * UIProcess/API/Cocoa/WKPreferences.mm:
     17        (-[WKPreferences _shouldAllowDesignSystemUIFonts]):
     18        (-[WKPreferences _setShouldAllowDesignSystemUIFonts:]):
     19        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
     20
    1212019-07-15  Brady Eidson  <beidson@apple.com>
    222
Note: See TracChangeset for help on using the changeset viewer.