Unbounded Element: Surface Allocation & macOS Light Dismissal (ESC key)

提交: f7dbd333 | 2026-05-15 16:12:10

← 返回列表

Unbounded Element: Surface Allocation & macOS Light Dismissal (ESC key)

Minor
提交哈希: f7dbd333bbcb6b0a90a866ed0a0a025927e898e8
提交时间: 2026-05-15 16:12:10
影响等级: Minor
生成工具: chromium-watcher
上游审核链接: 查看上游审核 🔗

📋 摘要

This commit implements browser-process surface allocation and macOS light dismissal for the Unbounded Element API. Key changes:
1. Enforces transient user gesture and privileged-context (WebUI/chrome://) checks in RenderFrameHostImpl::RequestUnboundedSurface.
2. Extends remote_cocoa::PopupWindowMac's local event monitor to observe ESC key press and trigger light dismissal.
3. Dispatches OnDismissed Mojo notifications when the popup closes.

🎯 影响分析

Impact on WebView2Mac is minor:

1. popup_window_mac.mm change (slight impact): The downstream Edge repo has the same file (content/app_shim_remote_cocoa/popup_window_mac.mm), currently only handling left/right mouse-down to close popups. The upstream commit adds ESC key dismissal logic (defines kVK_Escape constant, checks NSEventTypeKeyDown + keyCode==53 in the event monitor). This will affect popup windows used by WebView2Mac (e.g.,