Skip to content

[macOS 26] TestWebKitAPI.FontManagerTests.ChangeAttributesWithFontEffectsBox fails due to changes in NSFontPanel#52886

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
whsieh:eng/301352
Oct 23, 2025
Merged

[macOS 26] TestWebKitAPI.FontManagerTests.ChangeAttributesWithFontEffectsBox fails due to changes in NSFontPanel#52886
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
whsieh:eng/301352

Conversation

@whsieh
Copy link
Member

@whsieh whsieh commented Oct 23, 2025

114e809

[macOS 26] TestWebKitAPI.FontManagerTests.ChangeAttributesWithFontEffectsBox fails due to changes in NSFontPanel
https://bugs.webkit.org/show_bug.cgi?id=301352
rdar://163133860

Reviewed by Aditya Keerthi.

Since macOS 26, parts of the `NSFontPanel` UI have been reimplemented in Swift, or otherwise changed
so that styling options are now behind popovers and menus. As a result, all of the popup buttons
previously found by looking for `NSFontPanel*ToolbarItem` no longer exist.

This test currently tries (and fails) to interact with these nonexistent controls. Fix this by
changing how these tests work, such that they directly change the `_attributesToAdd` and
`_attributesToRemove` ivars that determine which text styles should be applied when calling into
`-changeAttributes:`.

* Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h:
* Tools/TestWebKitAPI/Tests/mac/FontManagerTests.mm:
(TestWebKitAPI::TEST(FontManagerTests, ChangeAttributesWithFontEffectsBox)):
* Tools/TestWebKitAPI/mac/NSFontPanelTesting.h:
* Tools/TestWebKitAPI/mac/NSFontPanelTesting.mm:
(-[NSBox _addAttribute:value:]):
(-[NSBox _removeAttribute:]):
(-[NSBox _clearAttributes]):

Add helpers to directly add or remove text styling attributes.

(-[NSFontPanel fontEffectsBox]):
(-[NSFontPanel setUnderlineStyle:]):
(-[NSFontPanel setStrikethroughStyle:]):
(-[NSFontPanel setTextShadow:]):
(-[NSFontPanel commitAttributeChanges]):
(findMenuItemWithTitle): Deleted.
(-[NSFontPanel chooseUnderlineMenuItemWithTitle:]): Deleted.
(-[NSFontPanel chooseStrikeThroughMenuItemWithTitle:]): Deleted.
(-[NSFontPanel toggleShadow]): Deleted.

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

eb2286e

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ❌ 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ❌ 🧪 api-wpe ✅ 🛠 vision-apple
🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ⏳ 🛠 jsc-armv7
✅ 🛠 tv-sim ⏳ 🧪 jsc-armv7-tests
✅ 🛠 watch
✅ 🛠 watch-sim

@whsieh whsieh self-assigned this Oct 23, 2025
@whsieh whsieh added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Oct 23, 2025
@whsieh whsieh added the merge-queue Applied to send a pull request to merge-queue label Oct 23, 2025
@whsieh
Copy link
Member Author

whsieh commented Oct 23, 2025

Thanks for the review!

…ectsBox fails due to changes in NSFontPanel

https://bugs.webkit.org/show_bug.cgi?id=301352
rdar://163133860

Reviewed by Aditya Keerthi.

Since macOS 26, parts of the `NSFontPanel` UI have been reimplemented in Swift, or otherwise changed
so that styling options are now behind popovers and menus. As a result, all of the popup buttons
previously found by looking for `NSFontPanel*ToolbarItem` no longer exist.

This test currently tries (and fails) to interact with these nonexistent controls. Fix this by
changing how these tests work, such that they directly change the `_attributesToAdd` and
`_attributesToRemove` ivars that determine which text styles should be applied when calling into
`-changeAttributes:`.

* Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h:
* Tools/TestWebKitAPI/Tests/mac/FontManagerTests.mm:
(TestWebKitAPI::TEST(FontManagerTests, ChangeAttributesWithFontEffectsBox)):
* Tools/TestWebKitAPI/mac/NSFontPanelTesting.h:
* Tools/TestWebKitAPI/mac/NSFontPanelTesting.mm:
(-[NSBox _addAttribute:value:]):
(-[NSBox _removeAttribute:]):
(-[NSBox _clearAttributes]):

Add helpers to directly add or remove text styling attributes.

(-[NSFontPanel fontEffectsBox]):
(-[NSFontPanel setUnderlineStyle:]):
(-[NSFontPanel setStrikethroughStyle:]):
(-[NSFontPanel setTextShadow:]):
(-[NSFontPanel commitAttributeChanges]):
(findMenuItemWithTitle): Deleted.
(-[NSFontPanel chooseUnderlineMenuItemWithTitle:]): Deleted.
(-[NSFontPanel chooseStrikeThroughMenuItemWithTitle:]): Deleted.
(-[NSFontPanel toggleShadow]): Deleted.

Canonical link: https://commits.webkit.org/302033@main
@webkit-commit-queue
Copy link
Collaborator

Committed 302033@main (114e809): https://commits.webkit.org/302033@main

Reviewed commits have been landed. Closing PR #52886 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 114e809 into WebKit:main Oct 23, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Oct 23, 2025
@whsieh whsieh deleted the eng/301352 branch October 23, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Bugs Unclassified bugs are placed in this component until the correct component can be determined.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants