[webkit-changes] [WebKit/WebKit] 53683c: Adding last resort font to System Font fallback se...

Russell Epstein noreply at github.com
Mon Dec 18 11:35:36 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 53683ca2146f70a7f63c8757f6a7106bfa53effe
      https://github.com/WebKit/WebKit/commit/53683ca2146f70a7f63c8757f6a7106bfa53effe
  Author: Russell Epstein <repstein at apple.com>
  Date:   2023-12-18 (Mon, 18 Dec 2023)

  Changed paths:
    A LayoutTests/fonts/font-cache-memory-pressure-crash-expected.txt
    A LayoutTests/fonts/font-cache-memory-pressure-crash.html
    M Source/WebCore/platform/graphics/FontCascadeFonts.cpp

  Log Message:
  -----------
  Adding last resort font to System Font fallback set for PUA characters
https://bugs.webkit.org/show_bug.cgi?id=264737
rdar://117805319

Reviewed by Brent Fulgham.

Until now, when we are purging inactive font data, we would just clear
the glyph page cache if we had to purge system fallback font.
This means that we consider glyph page cache would only point to
fonts from system fonts fallback.

When we are handling unicode's in the Private-User-Area (PUA) block,
we shouldn't fallback to system fonts searching for a font that can render
it, per spec: https://www.w3.org/TR/css-fonts-4/#char-handling-issues
Instead, we render the glyph 0 with the last resort font. However, this
font is just added to the custom font cache, and its font pointer in the
Glyph Page cache is not cleared during memory pressure.

We should add this font to the system font fallback set, to make sure
that the associated font pointer is removed from the glyph page cache
during memory pressure.

* LayoutTests/fonts/font-cache-memory-pressure-crash.html: Added.
* Source/WebCore/platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForVariant):
* LayoutTests/fonts/font-cache-memory-pressure-crash-expected.txt: Added.

Originally-landed-as: a595ddd8348d. rdar://119598929
Canonical link: https://commits.webkit.org/272231@main




More information about the webkit-changes mailing list