Rollback changes related to "Implementing popup menus with modern APIs"

Commit: 57c0d866 | 2025-03-12 18:57:57+00:00

← Back to List

Rollback changes related to "Implementing popup menus with modern APIs"

Minor
Commit Hash: 57c0d866fcfa1b8e26625b3f9d6b9392a17590cf
Commit Time: 2025-03-12 18:57:57+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review πŸ”—

πŸ“‹ Summary

This submission rolls back the previously introduced changes related to "Do popups using modern API" due to a bug on macOS where NSMenu.minimumWidth causes menu items to be truncated prematurely. The rollback involves multiple Cocoa code components related to menu popups and menu controllers, including the construction and properties of MenuControllerCocoa, menu popup logic, and related test code. The main change is to restore the old menu popup implementation and revert adaptations to the modern API and related interface modifications.

🎯 Impact Analysis

The impact on WebView2Mac is mainly reflected in the remote_cocoa-related menu popup and menu control logic. Since WebView2Mac relies on the menu popup mechanism of remote_cocoa (such as HTML select control popups, context menus, etc.), this rollback means that the menu popup logic will revert to the previous implementation, undoing the adaptation to modern APIs. If downstream WebView2Mac code does not directly depend on the β€œmodern API” interfaces being rolled back, functionality will remain consistent with the pre-rollback state, and no new compatibility issues will be introduced. If downstream code has already adapted to the new APIs, attention should be paid to the compilation or runtime compatibility impacts caused by the interface rollback. Overall, this rollback is a restoration of compatibility and will not have a significant impact on the core functionality of WebView2Mac in the short term, but attention should be paid to adaptation requirements when modern APIs are reintroduced in the future.

Impacted Classes:

MenuControllerCocoa WebMenuRunner ContextMenuRunner RenderWidgetHostViewCocoa MenuControllerCocoaDelegateImpl