Rollback the change that ignored input type changes in Mac text replacement functionality

Commit: 48d9baba | 2025-05-16 18:22:18+00:00

← Back to List

Rollback the change that ignored input type changes in Mac text replacement functionality

Moderate
Commit Hash: 48d9babacf9fafdee49580c79fcc6a0e95cce0c5
Commit Time: 2025-05-16 18:22:18+00:00
Impact Level: Moderate
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review 🔗

📋 Summary

This submission is a rollback operation, reverting previous modifications related to the Mac text replacement feature. The original changes attempted to ignore outdated text replacement operations by checking whether the text input type had changed within the text replacement callback, but these changes failed to resolve the associated crash issues. After the rollback, the system reverts to using the _availableTextChangeCounter-based change counter mechanism to track text state changes, and adds debugging information in the didAcceptReplacementString method for further analysis of potential anomalies. The main changes include: replacing capturedTextInputType with capturedChangeCounter, removing the text input type checking logic, and adding the SCOPED_CRASH_KEY_STRING256 macro for exception debugging.

🎯 Impact Analysis

The impact of this rollback on WebView2Mac is relatively limited, mainly reflected in changes to the behavior of the text replacement feature. As the rollback removes the outdated replacement check mechanism based on text input type, it may lead to improper text replacement operations in certain edge cases (such as when users rapidly switch between different input controls). However, the system still retains the check mechanism based on change counters, which can effectively prevent outdated text replacement in most scenarios. For WebView2Mac, this primarily affects the automatic replacement behavior of text input controls embedded in web pages, such as quote replacement, dash replacement, and automatic text replacement features. Since WebView2Mac relies on Remote Cocoa to handle macOS native text processing functionality, this change may impact the user's text editing experience within WebView2Mac controls, especially when using macOS system-level text replacement features. While the added debugging information is helpful for issue diagnosis, it may also introduce additional performance overhead in exceptional cases.

Impacted Classes:

RenderWidgetHostViewCocoa