[webkit-changes] [WebKit/WebKit] 04c2e0: Fix font-size-adjust toggling font sizes for 'syst...

Vitor Roriz noreply at github.com
Thu Aug 10 11:57:17 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 04c2e0b22b88d749e9400a8701765c6ca09a4f27
      https://github.com/WebKit/WebKit/commit/04c2e0b22b88d749e9400a8701765c6ca09a4f27
  Author: Vitor Roriz <vitor.roriz at apple.com>
  Date:   2023-08-10 (Thu, 10 Aug 2023)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-size-adjust-reload-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-size-adjust-reload-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-size-adjust-reload.html
    M Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp

  Log Message:
  -----------
  Fix font-size-adjust toggling font sizes for 'system-ui' font.
https://bugs.webkit.org/show_bug.cgi?id=259895
rdar://111709567

Reviewed by Tim Nguyen.

When using 'system-ui' font, we will end up calling FontFamilySpecificationCoreText::fontRanges for obtaining FontRanges
with an appended font.

Before this patch, ::fontRanges() was updating the font's size for the
font-size-adjust everytime fontRange was called. The update would mutate
the font that is cached. After the page is refreshed and this function
was called again, we would retrieve the cached font, and execute the
size adjustment again, what would cause the bug.

This patch moves the call to updateSizeWithFontSizeAdjust to the lambda
function invoked when the Font is being cached, guaranteeing it will be
called just once.

 * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-size-adjust-reload-expected.html: Added.
 * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-size-adjust-reload-ref.html: Added.
 * LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-size-adjust-reload.html: Added.
 * Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
 (WebCore::FontFamilySpecificationCoreText::fontRanges const):

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




More information about the webkit-changes mailing list