[Unified Text Replacement] Distinguish plain text and rich text replacements#26229
[Unified Text Replacement] Distinguish plain text and rich text replacements#26229webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Conversation
|
EWS run on previous version of this PR (hash 1fbc0f6) Details |
There was a problem hiding this comment.
(Double checking — oldData.originalText in the context of redo refers to the text after replacement?)
There was a problem hiding this comment.
Correct. I also realized I don't need to return a tuple here, since the first value is always the same. Will simplify that.
There was a problem hiding this comment.
Should this check if the WeakPtr is null and skip if so? Because we're triggering editing commands and layout in this loop, I suspect it's possible that some of the (previously non-null) markers in this vector could become null during iteration.
|
EWS run on previous version of this PR (hash 96b7930) Details
|
|
EWS run on previous version of this PR (hash b3f9eae) Details
|
|
EWS run on current version of this PR (hash c4f78cc) Details |
…cements https://bugs.webkit.org/show_bug.cgi?id=271351 rdar://123530706 Reviewed by Wenson Hsieh. Edit actions should have a different effect depending on whether a plain or rich text replacement is occuring. * Source/WebCore/dom/SimpleRange.h: * Source/WebKit/Scripts/webkit/messages.py: (headers_for_type): * Source/WebKit/Shared/UnifiedTextReplacement.serialization.in: * Source/WebKit/Shared/WebUnifiedTextReplacementContextData.h: * Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::willBeginTextReplacementSession): * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/UIProcess/mac/WebViewImpl.h: * Source/WebKit/UIProcess/mac/WebViewImpl.mm: (WebKit::WebViewImpl::willBeginTextReplacementSession): * Source/WebKit/WebProcess/WebPage/Cocoa/UnifiedTextReplacementController.mm: (WebKit::replaceTextInRange): Refactor to use `Document` rather than `Frame` so that common code can be shared, and indirection is reduced. (WebKit::replaceContentsInRange): Ditto (WebKit::replaceTextInRange). (WebKit::UnifiedTextReplacementController::willBeginTextReplacementSession): Store the replacement type for retrieval when an edit action is performed. (WebKit::UnifiedTextReplacementController::textReplacementSessionDidReceiveReplacements): (WebKit::UnifiedTextReplacementController::textReplacementSessionDidUpdateStateForReplacement): Committed and reverted state changes are now permanent. Do not restore the marker after it is removed. (WebKit::UnifiedTextReplacementController::didEndTextReplacementSession): (WebKit::UnifiedTextReplacementController::textReplacementSessionDidReceiveTextWithReplacementRange): (WebKit::UnifiedTextReplacementController::textReplacementSessionDidReceiveEditAction): (WebKit::UnifiedTextReplacementController::textReplacementSessionPerformEditActionForPlainText): Add a new path for plain text edit actions. Replacements are performed in reverse order to avoid recomputing ranges. (WebKit::UnifiedTextReplacementController::textReplacementSessionPerformEditActionForRichText): Preserve existing rich text behavior. * Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::willBeginTextReplacementSession): * Source/WebKit/WebProcess/WebPage/UnifiedTextReplacementController.h: Add a map of UUIDs to replacement types, to ensure the right method is used when an edit action is received. * Source/WebKit/WebProcess/WebPage/WebPage.h: * Source/WebKit/WebProcess/WebPage/WebPage.messages.in: Canonical link: https://commits.webkit.org/276490@main
c4f78cc to
b50554e
Compare
|
Committed 276490@main (b50554e): https://commits.webkit.org/276490@main Reviewed commits have been landed. Closing PR #26229 and removing active labels. |
🧪 services
b50554e
c4f78cc
🧪 wpe-wk2🧪 api-mac🧪 ios-wk2-wpt🧪 mac-wk1🧪 api-ios🧪 mac-AS-debug-wk2🧪 gtk-wk2🛠 tv-sim🧪 api-gtk🛠 watch