Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0082e68a004c11e97081c9dd39d6fe7df23ddd07
      
https://github.com/WebKit/WebKit/commit/0082e68a004c11e97081c9dd39d6fe7df23ddd07
  Author: Vitor Roriz <[email protected]>
  Date:   2026-07-08 (Wed, 08 Jul 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/FontCascadeFonts.cpp
    M Source/WebCore/platform/graphics/FontCascadeFonts.h
    M Source/WebCore/platform/graphics/coretext/ComplexTextControllerCoreText.mm
    M Tools/TestWebKitAPI/Tests/WebCore/FontCascade.cpp

  Log Message:
  -----------
  Complex text path should retain the system fallback fonts it uses
https://bugs.webkit.org/show_bug.cgi?id=318842
rdar://181117694

Reviewed by Brent Fulgham.

A GlyphBuffer cached in a FontCascadeFonts shaped text cache references its 
Fonts
through weak pointers (308842@main). The simple text path keeps the system
fallbacks it uses alive in FontCascadeFonts::glyphDataForSystemFallback, but the
complex text path did not, so a Core Text fallback used only there had a single
reference and FontCache::purgeInactiveFontData could destroy it while a cached
shaped run still referenced it. Painting that run then dereferenced an expired
weak pointer in FontCascade::drawGlyphBuffer. Therefore, retain those fallbacks
on the FontCascadeFonts the same way the simple path does.

* Source/WebCore/platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::addSystemFallbackFont):
* Source/WebCore/platform/graphics/FontCascadeFonts.h:
* Source/WebCore/platform/graphics/coretext/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* Tools/TestWebKitAPI/Tests/WebCore/FontCascade.cpp:
(TestWebKitAPI::TEST):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to