Changeset 252710 in webkit


Ignore:
Timestamp:
Nov 20, 2019 2:29:44 PM (4 years ago)
Author:
mmaxfield@apple.com
Message:

[Cocoa] Add ui-sans-serif as a sibling to ui-serif, ui-monospace, and ui-rounded
https://bugs.webkit.org/show_bug.cgi?id=204188

Reviewed by Simon Fraser.

Source/WebCore:

As per https://github.com/w3c/csswg-drafts/commit/cd0059a32a74c5a48630ce7c77292642dac70fd9#diff-dd2d54c50c872e1e303daebd4794d642

Test: fast/text/design-system-ui-sans-serif.html

  • platform/graphics/cocoa/FontCacheCoreText.cpp:

(WebCore::fontWithFamilySpecialCase):

  • platform/graphics/cocoa/FontDescriptionCocoa.cpp:

(WebCore::matchSystemFontUse):

LayoutTests:

  • fast/text/design-system-ui-sans-serif-expected.html: Added.
  • fast/text/design-system-ui-sans-serif.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r252706 r252710  
     12019-11-20  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Cocoa] Add ui-sans-serif as a sibling to ui-serif, ui-monospace, and ui-rounded
     4        https://bugs.webkit.org/show_bug.cgi?id=204188
     5
     6        Reviewed by Simon Fraser.
     7
     8        * fast/text/design-system-ui-sans-serif-expected.html: Added.
     9        * fast/text/design-system-ui-sans-serif.html: Added.
     10
    1112019-11-20  Truitt Savell  <tsavell@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r252702 r252710  
     12019-11-20  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Cocoa] Add ui-sans-serif as a sibling to ui-serif, ui-monospace, and ui-rounded
     4        https://bugs.webkit.org/show_bug.cgi?id=204188
     5
     6        Reviewed by Simon Fraser.
     7
     8        As per https://github.com/w3c/csswg-drafts/commit/cd0059a32a74c5a48630ce7c77292642dac70fd9#diff-dd2d54c50c872e1e303daebd4794d642
     9
     10        Test: fast/text/design-system-ui-sans-serif.html
     11
     12        * platform/graphics/cocoa/FontCacheCoreText.cpp:
     13        (WebCore::fontWithFamilySpecialCase):
     14        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
     15        (WebCore::matchSystemFontUse):
     16
    1172019-11-19  Brian Burg  <bburg@apple.com>
    218
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp

    r252034 r252710  
    12701270static RetainPtr<CTFontRef> fontWithFamilySpecialCase(const AtomString& family, const FontDescription& fontDescription, float size, AllowUserInstalledFonts allowUserInstalledFonts)
    12711271{
     1272    Optional<SystemFontDatabaseCoreText::ClientUse> designSystemUI;
     1273
    12721274#if HAVE(DESIGN_SYSTEM_UI_FONTS)
    1273     Optional<SystemFontDatabaseCoreText::ClientUse> designSystemUI;
    12741275    if (equalLettersIgnoringASCIICase(family, "ui-serif"))
    12751276        designSystemUI = SystemFontDatabaseCoreText::ClientUse::ForSystemUISerif;
     
    12781279    else if (equalLettersIgnoringASCIICase(family, "ui-rounded"))
    12791280        designSystemUI = SystemFontDatabaseCoreText::ClientUse::ForSystemUIRounded;
     1281#endif
     1282
     1283    if (equalLettersIgnoringASCIICase(family, "ui-sans-serif")) {
     1284        ASSERT(!designSystemUI);
     1285        designSystemUI = SystemFontDatabaseCoreText::ClientUse::ForSystemUI;
     1286    }
    12801287
    12811288    if (designSystemUI) {
     
    12841291            return createFontForInstalledFonts(cascadeList[0].get(), size, allowUserInstalledFonts);
    12851292    }
    1286 #else
    1287     UNUSED_PARAM(family);
    1288     UNUSED_PARAM(fontDescription);
    1289     UNUSED_PARAM(size);
    1290     UNUSED_PARAM(allowUserInstalledFonts);
    1291 #endif
    12921293
    12931294    return nullptr;
  • trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp

    r252034 r252710  
    5353        || equalLettersIgnoringASCIICase(string, "-apple-system")
    5454        || equalLettersIgnoringASCIICase(string, "-apple-system-font")
    55         || equalLettersIgnoringASCIICase(string, "system-ui"))
     55        || equalLettersIgnoringASCIICase(string, "system-ui")
     56        || equalLettersIgnoringASCIICase(string, "ui-sans-serif"))
    5657        return SystemFontDatabaseCoreText::ClientUse::ForSystemUI;
    5758
Note: See TracChangeset for help on using the changeset viewer.