Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0178384a1f67d59ceeda1fe047c356546e3e4c97
      
https://github.com/WebKit/WebKit/commit/0178384a1f67d59ceeda1fe047c356546e3e4c97
  Author: Wenson Hsieh <[email protected]>
  Date:   2025-10-22 (Wed, 22 Oct 2025)

  Changed paths:
    M Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h
    M Tools/TestWebKitAPI/Tests/mac/FontManagerTests.mm

  Log Message:
  -----------
  [macOS 26] TestWebKitAPI.FontManagerTests.ChangeFontWithPanel fails to set 
font styles
https://bugs.webkit.org/show_bug.cgi?id=301318
rdar://163133860

Reviewed by Abrar Rahman Protyasha.

`NSFontPanel` and `NSFontManager` were refactored in macOS 26, such that 
they're now partially
written in Swift. This breaks several of our API tests, including 
`ChangeFontWithPanel`, due to the
fact that nothing sets a font face name when we try to simulate font panel 
interactions, which then
causes all font changes to lose bold and italic styling.

Fix this by swizzling out `-_selectedFaceName` to override this font face name, 
and call
`-_chooseFace:` to force the font panel's `_selection` dictionary to update 
with this font face.

* Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h:
* Tools/TestWebKitAPI/Tests/mac/FontManagerTests.mm:
(TestWebKitAPI::overrideSelectedFaceName):
(TestWebKitAPI::setOverrideSelectedFaceName):
(TestWebKitAPI::TEST(FontManagerTests, ChangeFontWithPanel)):

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



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

Reply via email to