Rollback the out-of-order text replacement ignore mechanism in the text replacement feature
Moderate
Commit Hash:
ad31914866fc042402db19659724022370a0c7fa
Commit Time: 2025-05-05 19:03:33+00:00
Impact Level: Moderate
Generated By: webview2-upstream-sentry
Upstream Review:
View Upstream Review 🔗
📋 Summary
This submission is a rollback of the previous commit d5bf4ba9cd66ce8bc28939a6807777403f295259. The original commit aimed to prevent crashes by ignoring text corrections for legacy web content, but this change broke the text replacement functionality for all web page text fields. The main changes include: reverting the member variable from
_availableTextChangeNumber back to _availableTextChangeCounter, removing the version check logic during text replacement acceptance, and adding debugging information collection code to facilitate analysis of potential crash issues.
🎯 Impact Analysis
This rollback has a positive impact on WebView2Mac. The original change attempted to prevent crashes by checking the text version number, but inadvertently disabled all text replacement features, including autocorrection, quote substitution, hyphen substitution, and more. After the rollback, the text input experience in WebView2Mac will return to normal, and users will once again be able to use macOS’s smart text replacement features. Since these text replacement functions are implemented through Remote Cocoa’s RenderWidgetHostViewCocoa class, and WebView2Mac relies on this infrastructure to handle text input, this fix directly improves the text editing experience in WebView2Mac. The only potential risk is that the original issue (crashes caused by out-of-order text replacement) may reappear, but with the added debugging code, such problems can be better diagnosed and resolved.
Impacted Classes:
RenderWidgetHostViewCocoa