Use correct Objective-C property accessor names instead of isX prefix

提交: 6b0eeebd | 2026-05-01 18:34:46

← 返回列表

Use correct Objective-C property accessor names instead of isX prefix

Minor
提交哈希: 6b0eeebdb9f787ba08c291c43a937099a2f0fc66
提交时间: 2026-05-01 18:34:46
影响等级: Minor
生成工具: chromium-watcher
上游审核链接: 查看上游审核 🔗

📋 摘要

This commit renames Objective-C dot-syntax property accessors from the isX prefix form to the correct property name form (e.g., .isVisible → .visible, .isKeyWindow → .keyWindow, .isOnActiveSpace → .onActiveSpace, .isMovable → .movable, .isZoomed → .zoomed). This is a purely cosmetic/style fix — both forms call the same getter method with no behavioral change. It touches 12 files including remote_cocoa bridge layer, immersive mode controller, render widget host view, and iOS-related code.

🎯 影响分析

This change has minimal impact on WebView2Mac — it is a pure coding style fix with no behavioral change. Detailed analysis:

1. **Directly affected remote_cocoa files**:
- native_widget_ns_window_bridge.mm: Changes dot-syntax in OrderChildren() (window.isVisible/isOnActiveSpace) and CheckAndNotifyZoomedStateChanged() (window_.isZoomed). The downstream Edge repo has custom modifications in CheckAndNotifyZoomedStateChanged() (added window_zoomed_ caching logic), so the upstream context differs and **auto-merge may produce a conflict** — but it only involves a style change and is easy to resolve.
- native_widget_mac_nswindow.mm: Changes self.window.isMovable.movable and self.isOnActiveSpace.onActiveSpace. Downstream lines match, auto-merge should be clean.
- immersive_mode_controller_cocoa.mm: Changes window.isOnActiveSpace.onActiveSpace. Downstream matches, clean merge expected.
- render_widget_host_view_cocoa.mm: Changes [self window].isKeyWindow.keyWindow. Downstream matches, clean merge expected.

2. **Downstream WebView2-specific files**:
- hosting_ns_window_bridge.mm has OrderChildren() using the same old-style dot syntax window.isVisible || window.isOnActiveSpace (line 819), plus multiple bracket-syntax calls [ns_window() isVisible], [ns_window() isKeyWindow]. Bracket syntax is unaffected. The dot-syntax usage should be updated for consistency in a follow-up.
- hosting_ns_window_delegate.mm uses bracket syntax only, unaffected.

3. **Merge risk**: Minor conflict possible in native_widget_ns_window_bridge.mm at CheckAndNotifyZoomedStateChanged() due to downstream code divergence, but it is context-only and does not involve logic issues.

受影响的类:

remote_cocoa::NativeWidgetNSWindowBridge remote_cocoa::NativeWidgetMacNSWindow remote_cocoa::ImmersiveModeControllerCocoa RenderWidgetHostViewCocoa HostingNSWindowBridge