[webkit-changes] [WebKit/WebKit] e213ae: Font caches need to be invalidated when the font c...

Simon Fraser noreply at github.com
Tue Jan 16 08:45:59 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e213ae74ae87ab8274aec65366b7981129b6f882
      https://github.com/WebKit/WebKit/commit/e213ae74ae87ab8274aec65366b7981129b6f882
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2024-01-16 (Tue, 16 Jan 2024)

  Changed paths:
    M Source/WebCore/animation/KeyframeEffect.cpp
    M Source/WebCore/platform/graphics/cocoa/FontCacheCocoa.mm
    M Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp

  Log Message:
  -----------
  Font caches need to be invalidated when the font content size category changes
https://bugs.webkit.org/show_bug.cgi?id=267564
rdar://121024996

Reviewed by Antoine Quint.

On iOS with https://github.com/WebKit/WebKit/pull/22531, fast/attachment/attachment-dynamic-type.html fails,
showing that fonts failed to update after we change `contentSizeCategory()` via Internals.

When the content size category changes via the user setting it in the UI, we get notified
via a `UIContentSizeCategoryDidChangeNotification` notification, and in response to this
we call `FontCache::invalidateAllFontCaches()` (see `fontCacheRegisteredFontsChangedNotificationCallback()`).
So we need to do the same when the content size category is changed through Internals.

This caused webanimations/css-animation-effect-target-change-and-get-keyframes-crash.html to crash
with a null m_target, so add a null check in `computeCSSAnimationBlendingKeyframes()`.

* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes):
* Source/WebCore/platform/graphics/cocoa/FontCacheCocoa.mm:
(WebCore::setContentSizeCategory):
* Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::platformInit):

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




More information about the webkit-changes mailing list