Fix the issue of resetting the hit test target when TabTitlebarView is removed in fullscreen mode
Moderate
Commit Hash:
9aac7d8cf1a91ea76760fd621265c36e2e2bac7a
Commit Time: 2025-09-08 17:10:00+00:00
Impact Level: Moderate
Generated By: webview2-upstream-sentry
Upstream Review:
View Upstream Review 🔗
📋 Summary
This submission primarily addresses a race condition issue that occurred when TabTitlebarView was removed from NSToolbarFullScreenWindow in fullscreen mode. Specific changes include: 1) Modified the SetNSNextStepFrameHitTestTargetView function signature, which now accepts separate fullscreen_window and target_view parameters; 2) Added the tabContentView method and improved viewDidMoveToWindow logic in TabTitlebarView; 3) Allowed passing nil as target_view to reset the hit test target. These changes are intended to prevent CHECK failures caused by race conditions between view removal and event dispatch.
🎯 Impact Analysis
The impact of this change on WebView2Mac is moderate. The main effects are as follows: 1) Function signature change: The signature of the SetNSNextStepFrameHitTestTargetView function has undergone an incompatible change. If downstream WebView2Mac code directly calls this function, the invocation method needs to be updated accordingly; 2) Feature enhancement: The new implementation provides better error handling and race condition protection, which benefits the stability of WebView2Mac in fullscreen mode; 3) Interface extension: Allowing nil target_view offers downstream code a more flexible way to manage hit test targets. Since this is a core hit test feature of remote_cocoa, WebView2Mac may need to adapt to these changes if it utilizes related fullscreen mode functionality.
Impacted Classes:
SetNSNextStepFrameHitTestTargetView
TabTitlebarView
remote_cocoa::ImmersiveModeTabbedControllerCocoa