[webkit-changes] [WebKit/WebKit] 17737e: Making exception for Apple logo (U+F8FF) on PUA ch...

Vitor Roriz noreply at github.com
Thu Dec 21 09:11:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 17737ef944ac199ac06b48ead10be64069cb90e0
      https://github.com/WebKit/WebKit/commit/17737ef944ac199ac06b48ead10be64069cb90e0
  Author: Vitor Roriz <vitor.roriz at apple.com>
  Date:   2023-12-21 (Thu, 21 Dec 2023)

  Changed paths:
    A LayoutTests/fast/css/font-fallback-private-use-area-apple-logo-exception-expected.html
    A LayoutTests/fast/css/font-fallback-private-use-area-apple-logo-exception.html
    A LayoutTests/platform/gtk/fast/css/font-fallback-private-use-area-apple-logo-exception-expected.html
    A LayoutTests/platform/wpe/fast/css/font-fallback-private-use-area-apple-logo-exception-expected.html
    M Source/WebCore/platform/graphics/FontCascadeFonts.cpp

  Log Message:
  -----------
  Making exception for Apple logo (U+F8FF) on PUA characters font fallback
https://bugs.webkit.org/show_bug.cgi?id=266664
rdar://119517735

Reviewed by Brent Fulgham.

WebKit currently complies to CSS fonts specification https://drafts.csswg.org/css-fonts-4/#char-handling-issues
on the fallback behavior for PUA characters.
This was implemented at https://bugs.webkit.org/show_bug.cgi?id=263261

The specification requires that the engine doesn't fallback to
system fonts if a character belongs to the Private Use Area (PUA) block.
If the author specifies a font that can render such character, we still resolve
that glyph accordingly, but if no font specified can do that we won't fallback
to a system font.

The problem:
The codepoint U+F8FF, which is in the PUA block, is traditionally mapped to the Apple logo
in some system fonts like 'Times Roman' on Apple platforms.
Since we have always falled back to system fonts (before the patch mentioned before),
some authors might expect that U+F8FF is supported, for example, by "Verdana"
since they are not aware that under the hood WebKit would fallback to a system
font for rendering such a glyph.

For that reason, we are creating an exception for the U+F8FF codepoint:
http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/CORPCHAR.TXT

This seems to be compatible with other engines. Blink, for example,
handled this at:
"Add support for PUA unicode codepoint for Apple Logo on Mac":
https://chromium-review.googlesource.com/c/chromium/src/+/2785423

Note that, browsers on other non-Apple platforms will most likely still render
.notdef for this codepoint, since system fonts there won't be mapping
it to the Apple logo.

* LayoutTests/fast/css/font-fallback-private-use-area-apple-logo-exception-expected.html: Added.
* LayoutTests/fast/css/font-fallback-private-use-area-apple-logo-exception.html: Added.
* LayoutTests/platform/gtk/fast/css/font-fallback-private-use-area-apple-logo-exception-expected.html: Added.
* LayoutTests/platform/wpe/fast/css/font-fallback-private-use-area-apple-logo-exception-expected.html: Added.
* Source/WebCore/platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForVariant):

Canonical link: https://commits.webkit.org/272417@main




More information about the webkit-changes mailing list